Skip to content

Commit

Permalink
Don't call zypper with more than one --no-refresh
Browse files Browse the repository at this point in the history
Now zypper started being picky and errors out when --no-refresh is
passed twice. Make sure we won't hit this.
  • Loading branch information
cbosdo authored and brejoc committed Feb 1, 2019
1 parent f6704cd commit 5130f25
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion salt/modules/zypper.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def __call(self, *args, **kwargs):
self.__called = True
if self.__xml:
self.__cmd.append('--xmlout')
if not self.__refresh:
if not self.__refresh and '--no-refresh' not in args:
self.__cmd.append('--no-refresh')
if self.__root:
self.__cmd.extend(['--root', self.__root])
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/modules/test_zypper.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def __call__(self, *args, **kwargs):
self.assertEqual(zypper.__zypper__.call('foo'), stdout_xml_snippet)
self.assertEqual(len(sniffer.calls), 1)

zypper.__zypper__.call('bar')
zypper.__zypper__.call('--no-refresh', 'bar')
self.assertEqual(len(sniffer.calls), 2)
self.assertEqual(sniffer.calls[0]['args'][0], ['zypper', '--non-interactive', '--no-refresh', 'foo'])
self.assertEqual(sniffer.calls[1]['args'][0], ['zypper', '--non-interactive', '--no-refresh', 'bar'])
Expand Down

0 comments on commit 5130f25

Please sign in to comment.