Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12:Update
salt.3514
0081-Including-resolver-params-for-Zypper-debug...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0081-Including-resolver-params-for-Zypper-debug-solver.patch of Package salt.3514
From c4ef1c1e02b42a2070ce02dc28a2dddc5f861dd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20Su=C3=A1rez=20Hern=C3=A1ndez?= <psuarezhernandez@suse.com> Date: Mon, 31 Oct 2016 16:15:36 +0000 Subject: [PATCH 81/81] Including resolver params for Zypper debug-solver Now '--no-allow-vendor-change' and '--from' parameters are included into the zypper --debug-solver call before performing a dry-run dist-upgrade. --- salt/modules/zypper.py | 10 +++++----- tests/unit/modules/zypper_test.py | 7 +++++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py index 59c6b73..5d7197c 100644 --- a/salt/modules/zypper.py +++ b/salt/modules/zypper.py @@ -1050,11 +1050,6 @@ def upgrade(refresh=True, cmd_update.append('--dry-run') 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]) @@ -1068,6 +1063,11 @@ def upgrade(refresh=True, else: log.warn('Disabling vendor changes is not supported on this Zypper version') + 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']) + old = list_pkgs() __zypper__.noraise.call(*cmd_update) if __zypper__.exit_code not in __zypper__.SUCCESS_EXIT_CODES: diff --git a/tests/unit/modules/zypper_test.py b/tests/unit/modules/zypper_test.py index bc4860e..87606a3 100644 --- a/tests/unit/modules/zypper_test.py +++ b/tests/unit/modules/zypper_test.py @@ -358,6 +358,13 @@ class ZypperTestCase(TestCase): zypper_mock.assert_any_call('dist-upgrade', '--auto-agree-with-licenses', '--dry-run') zypper_mock.assert_any_call('dist-upgrade', '--auto-agree-with-licenses', '--dry-run', '--debug-solver') + with patch('salt.modules.zypper.list_pkgs', MagicMock(side_effect=[{"vim": "1.1"}, {"vim": "1.1"}])): + ret = zypper.upgrade(dist_upgrade=True, dryrun=True, fromrepo=["Dummy", "Dummy2"], novendorchange=True) + self.assertTrue(ret['result']) + self.assertDictEqual(ret['changes'], {}) + zypper_mock.assert_any_call('dist-upgrade', '--auto-agree-with-licenses', '--dry-run', '--from', "Dummy", '--from', 'Dummy2', '--no-allow-vendor-change') + zypper_mock.assert_any_call('dist-upgrade', '--auto-agree-with-licenses', '--dry-run', '--from', "Dummy", '--from', 'Dummy2', '--no-allow-vendor-change', '--debug-solver') + with patch('salt.modules.zypper.list_pkgs', MagicMock(side_effect=[{"vim": "1.1"}, {"vim": "1.2"}])): ret = zypper.upgrade(dist_upgrade=True, fromrepo=["Dummy", "Dummy2"], novendorchange=True) self.assertTrue(ret['result']) -- 2.10.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor