mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #47518 from Ch3LL/zfs_support
Fix 47364: ensure we are not caching zfs.is_supported
This commit is contained in:
commit
fe4e79f1de
2 changed files with 12 additions and 2 deletions
|
@ -279,7 +279,6 @@ def _command(source, command, flags=None, opts=None,
|
|||
return ' '.join(cmd)
|
||||
|
||||
|
||||
@real_memoize
|
||||
def is_supported():
|
||||
'''
|
||||
Check the system for ZFS support
|
||||
|
@ -302,7 +301,7 @@ def is_supported():
|
|||
on_supported_platform = True
|
||||
|
||||
# Additional check for the zpool command
|
||||
return (_zpool_cmd() and on_supported_platform) is True
|
||||
return (salt.utils.path.which('zpool') and on_supported_platform) is True
|
||||
|
||||
|
||||
@real_memoize
|
||||
|
|
|
@ -891,6 +891,17 @@ class ZfsUtilsTestCase(TestCase):
|
|||
This class contains a set of functions that test salt.utils.zfs utils
|
||||
'''
|
||||
## NOTE: test parameter parsing
|
||||
def test_is_supported(self):
|
||||
'''
|
||||
Test zfs.is_supported method
|
||||
'''
|
||||
for value in [False, True]:
|
||||
with patch('salt.utils.path.which',
|
||||
MagicMock(return_value=value)):
|
||||
with patch('salt.utils.platform.is_linux',
|
||||
MagicMock(return_value=value)):
|
||||
self.assertEqual(value, zfs.is_supported())
|
||||
|
||||
def test_property_data_zpool(self):
|
||||
'''
|
||||
Test parsing of zpool get output
|
||||
|
|
Loading…
Add table
Reference in a new issue