Skip to content

Commit

Permalink
Merge branch 'develop' into merge-deveop
Browse files Browse the repository at this point in the history
  • Loading branch information
twangboy authored May 9, 2019
2 parents 58ba7a6 + 1cbf79a commit 1d836a6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
4 changes: 3 additions & 1 deletion salt/modules/zypperpkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -2222,7 +2222,9 @@ def _pattern_name(capability):
if root:
cmd.extend(['--root', root])
cmd.extend(['-q', '--provides', '--whatprovides', 'pattern()'])
output = __salt__['cmd.run'](cmd)
# If no `pattern()`s are found, RPM returns `1`, but for us is not
# a real error.
output = __salt__['cmd.run'](cmd, ignore_retcode=True)

installed_patterns = [_pattern_name(line) for line in output.splitlines()
if line.startswith('pattern() = ')]
Expand Down
5 changes: 3 additions & 2 deletions tests/unit/modules/test_btrfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals

import os
import pytest

# Import Salt Testing Libs
Expand Down Expand Up @@ -410,12 +410,13 @@ def test_subvolume_create(self, subvolume_exists):
salt_mock = {
'cmd.run_all': MagicMock(return_value={'recode': 0}),
}
expected_path = os.path.join('/mnt', 'var')
with patch.dict(btrfs.__salt__, salt_mock):
assert btrfs.subvolume_create('var', dest='/mnt')
subvolume_exists.assert_called_once()
salt_mock['cmd.run_all'].assert_called_once()
salt_mock['cmd.run_all'].assert_called_with(
['btrfs', 'subvolume', 'create', '/mnt/var'])
['btrfs', 'subvolume', 'create', expected_path])

def test_subvolume_delete_fails_parameters(self):
'''
Expand Down

0 comments on commit 1d836a6

Please sign in to comment.