#NEWLINE# def removed( name , version = None , pkgs = None , normalize = True , ignore_epoch = False , **kwargs ) : #NEWLINE# #INDENT# "\n    Verify that a package is not installed, calling ``pkg.remove`` if necessary\n    to remove the package.\n\n    name\n        The name of the package to be removed.\n\n    version\n        The version of the package that should be removed. Don't do anything if\n        the package is installed with an unmatching version.\n\n        .. important::\n            As of version 2015.8.7, for distros which use yum/dnf, packages\n            which have a version with a nonzero epoch (that is, versions which\n            start with a number followed by a colon like in the example above)\n            must have the epoch included when specifying the version number.\n            For example:\n\n            .. code-block:: yaml\n\n                vim-enhanced:\n                  pkg.installed:\n                    - version: 2:7.4.160-1.el7\n\n            In version 2015.8.9, an **ignore_epoch** argument has been added to\n            :py:mod:`pkg.installed <salt.states.pkg.installed>`,\n            :py:mod:`pkg.removed <salt.states.pkg.installed>`, and\n            :py:mod:`pkg.purged <salt.states.pkg.installed>` states, which\n            causes the epoch to be disregarded when the state checks to see if\n            the desired version was installed. If **ignore_epoch** was not set\n            to ``True``, and instead of ``2:7.4.160-1.el7`` a version of\n            ``7.4.160-1.el7`` were used, this state would report success since\n            the actual installed version includes the epoch, and the specified\n            version would not match.\n\n    normalize : True\n        Normalize the package name by removing the architecture, if the\n        architecture of the package is different from the architecture of the\n        operating system. The ability to disable this behavior is useful for\n        poorly-created packages which include the architecture as an actual\n        part of the name, such as kernel modules which match a specific kernel\n        version.\n\n        .. versionadded:: 2015.8.0\n\n    ignore_epoch : False\n        When a package version contains an non-zero epoch (e.g.\n        ``1:3.14.159-2.el7``, and a specific version of a package is desired,\n        set this option to ``True`` to ignore the epoch when comparing\n        versions. This allows for the following SLS to be used:\n\n        .. code-block:: yaml\n\n            # Actual vim-enhanced version: 2:7.4.160-1.el7\n            vim-enhanced:\n              pkg.removed:\n                - version: 7.4.160-1.el7\n                - ignore_epoch: True\n\n        Without this option set to ``True`` in the above example, the state\n        would falsely report success since the actual installed version is\n        ``2:7.4.160-1.el7``. Alternatively, this option can be left as\n        ``False`` and the full version string (with epoch) can be specified in\n        the SLS file:\n\n        .. code-block:: yaml\n\n            vim-enhanced:\n              pkg.removed:\n                - version: 2:7.4.160-1.el7\n\n        .. versionadded:: 2015.8.9\n\n    Multiple Package Options:\n\n    pkgs\n        A list of packages to remove. Must be passed as a python list. The\n        ``name`` parameter will be ignored if this option is passed. It accepts\n        version numbers as well.\n\n        .. versionadded:: 0.16.0\n    " #NEWLINE# kwargs [ 'saltenv' ] = __env__ #NEWLINE# try : #NEWLINE# #INDENT# return _uninstall ( action = 'remove' , name = name , version = version , pkgs = pkgs , normalize = normalize , ignore_epoch = ignore_epoch , ** kwargs ) #NEWLINE# #UNINDENT# except CommandExecutionError as exc : #NEWLINE# #INDENT# ret = { #NEWLINE# #INDENT# 'name' : name , #NEWLINE# 'result' : False , #NEWLINE# #UNINDENT# } #NEWLINE# if exc . info : #NEWLINE# #INDENT# ret [ 'changes' ] = exc . info . get ( 'changes' , { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# ret [ 'comment' ] = exc . strerror_without_changes #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# ret [ 'changes' ] = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# ret [ 'comment' ] = 'An error was encountered while removing package(s): {0}' . format ( exc ) #NEWLINE# #UNINDENT# return ret