44f6a131de
- Update to 2016.3.4 see https://docs.saltstack.com/en/latest/topics/releases/2016.3.4.html - Removed Patches, applied upstream * 0008-checksum-validation-when-zypper-pkg.download.patch * 0009-unit-tests-for-rpm.checksum-and-zypper.download.patch * 0010-snapper-execution-module.patch * 0011-fix-salt-summary-to-count-not-responding-minions-cor.patch * 0012-Run-salt-api-as-user-salt-bsc-990029.patch * 0013-Deprecate-status.uptime-one-version-later.patch * 0014-Add-ignore_repo_failure-option-to-suppress-zypper-s-.patch * 0015-Remove-zypper-s-raise-exception-if-mod_repo-has-no-a.patch * 0016-Improve-Mock-to-be-flexible-and-able-to-mock-methods.patch * 0017-Check-for-single-quote-before-splitting-on-single-qu.patch * 0018-Unit-tests-fixes-for-2016.3.2.patch * 0019-Fix-snapper_test-for-python26.patch * 0020-Integration-tests-fixes-for-2016.3.2.patch * 0021-Fix-pkg.upgrade-for-zypper.patch * 0022-Setting-up-OS-grains-for-SLES-Expanded-Support-SUSE-.patch * 0023-acl.delfacl-fix-position-of-X-option-to-setfacl.patch * 0024-Change-travis-configuration-file-to-use-salt-toaster.patch * 0025-Adding-dist-upgrade-support-to-zypper-module.patch * 0026-Fix-pkg.latest_version-when-latest-already-installed.patch * 0027-Including-resolver-params-for-Zypper-debug-solver.patch - Added patches * 0008-snapper-execution-module.patch * 0009-fix-salt-summary-to-count-not-responding-minions-cor.patch * 0010-Run-salt-api-as-user-salt-bsc-990029.patch * 0011-Fix-snapper_test-for-python26.patch * 0012-Fix-pkg.upgrade-for-zypper.patch * 0013-Setting-up-OS-grains-for-SLES-Expanded-Support-SUSE-.patch OBS-URL: https://build.opensuse.org/request/show/438684 OBS-URL: https://build.opensuse.org/package/show/systemsmanagement:saltstack/salt?expand=0&rev=81
100 lines
3.8 KiB
Diff
100 lines
3.8 KiB
Diff
From db37086d3322aeba397ed7f66925b51fc61f4fca Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?=
|
|
<psuarezhernandez@suse.com>
|
|
Date: Tue, 18 Oct 2016 14:14:42 +0100
|
|
Subject: [PATCH 16/18] Adding 'dist-upgrade' support to zypper module
|
|
|
|
* Unit tests for zypper upgrade and dist-upgrade
|
|
* Refactor: Cleanup and pylint fixes
|
|
* Fix in log message
|
|
* Adds multiple repositories support to 'fromrepo' parameter
|
|
* Improves 'dryrun' outputting. Setting 'novendorchange' as not supported for SLE11
|
|
* Unit tests fixes
|
|
* Minor pylint fixes
|
|
* Disables 'novendorchange' for old SLEs versions
|
|
---
|
|
salt/modules/zypper.py | 45 ++++++++++++++++++++++++++++-----------------
|
|
1 file changed, 28 insertions(+), 17 deletions(-)
|
|
|
|
diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
|
|
index 49ce5ecc5409..d1febee73597 100644
|
|
--- a/salt/modules/zypper.py
|
|
+++ b/salt/modules/zypper.py
|
|
@@ -1072,34 +1072,25 @@ def install(name=None,
|
|
|
|
|
|
def upgrade(refresh=True,
|
|
+ skip_verify=False,
|
|
dryrun=False,
|
|
dist_upgrade=False,
|
|
fromrepo=None,
|
|
novendorchange=False,
|
|
- skip_verify=False,
|
|
**kwargs): # pylint: disable=unused-argument
|
|
'''
|
|
- .. versionchanged:: 2015.8.12,2016.3.3,Carbon
|
|
- On minions running systemd>=205, `systemd-run(1)`_ is now used to
|
|
- isolate commands which modify installed packages from the
|
|
- ``salt-minion`` daemon's control group. This is done to keep systemd
|
|
- from killing any zypper commands spawned by Salt when the
|
|
- ``salt-minion`` service is restarted. (see ``KillMode`` in the
|
|
- `systemd.kill(5)`_ manpage for more information). If desired, usage of
|
|
- `systemd-run(1)`_ can be suppressed by setting a :mod:`config option
|
|
- <salt.modules.config.get>` called ``systemd.scope``, with a value of
|
|
- ``False`` (no quotes).
|
|
-
|
|
- .. _`systemd-run(1)`: https://www.freedesktop.org/software/systemd/man/systemd-run.html
|
|
- .. _`systemd.kill(5)`: https://www.freedesktop.org/software/systemd/man/systemd.kill.html
|
|
-
|
|
Run a full system upgrade, a zypper upgrade
|
|
|
|
+ Options:
|
|
+
|
|
refresh
|
|
force a refresh if set to True (default).
|
|
If set to False it depends on zypper if a refresh is
|
|
executed.
|
|
|
|
+ skip_verify
|
|
+ Skip the GPG verification check (e.g., ``--no-gpg-checks``)
|
|
+
|
|
dryrun
|
|
If set to True, it creates a debug solver log file and then perform
|
|
a dry-run upgrade (no changes are made). Default: False
|
|
@@ -1164,10 +1155,30 @@ def upgrade(refresh=True,
|
|
if skip_verify:
|
|
cmd_update.append('--no-gpg-checks')
|
|
|
|
- old = list_pkgs()
|
|
+ if dryrun:
|
|
+ cmd_update.append('--dry-run')
|
|
|
|
- __zypper__(systemd_scope=_systemd_scope()).noraise.call(*cmd_update)
|
|
+ if dist_upgrade:
|
|
+ if dryrun:
|
|
+ # Creates a solver test case for debugging.
|
|
+ log.info('Executing debugsolver and performing a dry-run dist-upgrade')
|
|
+ __zypper__.noraise.call(*cmd_update + ['--debug-solver'])
|
|
+
|
|
+ if fromrepo:
|
|
+ for repo in fromrepo:
|
|
+ cmd_update.extend(['--from', repo])
|
|
+ log.info('Targeting repos: {0!r}'.format(fromrepo))
|
|
|
|
+ if novendorchange:
|
|
+ # TODO: Grains validation should be moved to Zypper class
|
|
+ if __grains__['osrelease_info'][0] > 11:
|
|
+ cmd_update.append('--no-allow-vendor-change')
|
|
+ log.info('Disabling vendor changes')
|
|
+ else:
|
|
+ log.warn('Disabling vendor changes is not supported on this Zypper version')
|
|
+
|
|
+ old = list_pkgs()
|
|
+ __zypper__(systemd_scope=_systemd_scope()).noraise.call(*cmd_update)
|
|
if __zypper__.exit_code not in __zypper__.SUCCESS_EXIT_CODES:
|
|
ret['result'] = False
|
|
else:
|
|
--
|
|
2.10.1
|
|
|