This works around a bug in the yum python API where removal of packages
that are required by other packages results in the removal of those
packages as well, and does not raise an exception when errors are
encountered during the transaction test, causing all packages to be
removed.
This commit manually performs the transaction test, and raises an
exception if any errors are found. It also adds a try/except to the
pkg.removed and pkg.purged states which catches the exception and
gracefully returns False without a traceback.
See https://github.com/saltstack/salt/issues/8201 for more information.
If a package is added using a pkgrepo.managed state, and a pkg.installed
state needs access to this newly-added repo, it will not be able to find
the package since the pkg.refresh_db happens in the call to pkg.install
(just prior to the package installation), and not when the package
targets are initially looked for. This commit adds a pkg.refresh_db
before the targets are checked, and then supresses the refresh_db when
the package is actually installed (because at that point, it would be
redundant).
This commit modifies apt.py's expand_repo_def and list_repos (as well as
get_repo, as it uses list_repos) functions to strip the trailing slash.
This allows for repo definitions to be created with trailing slashes,
and for a trailing slash to not result in a failure to match a repo.
Additionally, this commit has fixes for generic "raise Exception" usage,
instead using salt.exceptions.CommandExecutionError as it avoids
tracebacks in the CLI output.
Finally, some manual quoting has been converted to using raw strings.
Make it similar to what verify_env already does, so that
we tell people exactly which path was a problem. I hit this
while running salt-master in a non-standard configuration, and
the change makes it easier to hunt down which path is wrong
in a config.
Fixes "ImportError: No module named audio" on SmartOS
Uses 'email.mime.*' rather than a full list of entries.
Also removes a duplicate entry for 'fileinput' from the
windows section that was added to the main FREEZER_INCLUDES
Email thread that suggested this fix:
https://groups.google.com/forum/#!msg/salt-users/_9ynHspSgjk/so0hRdbaPM0J
Tested as a fix to a 0.17.1 checkout on SmartOS.