#NEWLINE# def removed( name , cyg_arch = 'x86_64' , mirrors = None ) : #NEWLINE# #INDENT# '\n    Make sure that a package is not installed.\n\n    name\n        The name of the package to uninstall\n\n    cyg_arch : x86_64\n        The cygwin architecture to remove the package from.\n        Current options are x86 and x86_64\n\n    mirrors : None\n        List of mirrors to check.\n        None will use a default mirror (kernel.org)\n\n    CLI Example:\n\n    .. code-block:: yaml\n\n        rsync:\n          cyg.removed:\n            - mirrors:\n              - http://mirror/without/public/key: ""\n              - http://mirror/with/public/key: http://url/of/public/key\n    ' #NEWLINE# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : None , #NEWLINE# 'comment' : '' , #NEWLINE# 'changes' : { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } , #NEWLINE# #UNINDENT# } #NEWLINE# if ( cyg_arch not in [ 'x86' , 'x86_64' ] ) : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = "The 'cyg_arch' argument must be one of 'x86' or 'x86_64'" #NEWLINE# return ret #NEWLINE# #UNINDENT# if ( not __salt__ [ 'cyg.check_valid_package' ] ( name , cyg_arch = cyg_arch , mirrors = mirrors ) ) : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Invalid package name.' #NEWLINE# return ret #NEWLINE# #UNINDENT# if ( name not in __salt__ [ 'cyg.list' ] ( name , cyg_arch ) ) : #NEWLINE# #INDENT# ret [ 'result' ] = True #NEWLINE# ret [ 'comment' ] = 'Package is not installed.' #NEWLINE# return ret #NEWLINE# #UNINDENT# if __opts__ [ 'test' ] : #NEWLINE# #INDENT# ret [ 'comment' ] = 'The package {0} would have been removed' . format ( cyg_arch ) #NEWLINE# return ret #NEWLINE# #UNINDENT# if __salt__ [ 'cyg.uninstall' ] ( name , cyg_arch ) : #NEWLINE# #INDENT# ret [ 'result' ] = True #NEWLINE# ret [ 'changes' ] [ name ] = 'Removed' #NEWLINE# ret [ 'comment' ] = 'Package was successfully removed.' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'result' ] = False #NEWLINE# ret [ 'comment' ] = 'Could not remove package.' #NEWLINE# #UNINDENT# return ret