mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #27149 from twangboy/fix_27133
Fixed problem with add/remove path
This commit is contained in:
commit
59e9dfd8de
2 changed files with 4 additions and 4 deletions
|
@ -72,7 +72,7 @@ def get_path():
|
|||
|
||||
salt '*' win_path.get_path
|
||||
'''
|
||||
ret = __salt__['reg.read_key']('HKEY_LOCAL_MACHINE',
|
||||
ret = __salt__['reg.read_value']('HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment',
|
||||
'PATH')
|
||||
if isinstance(ret, dict):
|
||||
|
@ -149,8 +149,8 @@ def add(path, index=0):
|
|||
regedit = __salt__['reg.set_value'](
|
||||
'HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment',
|
||||
';'.join(sysPath),
|
||||
'PATH',
|
||||
';'.join(sysPath),
|
||||
'REG_EXPAND_SZ'
|
||||
)
|
||||
|
||||
|
@ -186,8 +186,8 @@ def remove(path):
|
|||
regedit = __salt__['reg.set_value'](
|
||||
'HKEY_LOCAL_MACHINE',
|
||||
'SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Environment',
|
||||
';'.join(sysPath),
|
||||
'PATH',
|
||||
';'.join(sysPath),
|
||||
'REG_EXPAND_SZ'
|
||||
)
|
||||
if regedit:
|
||||
|
|
|
@ -70,7 +70,7 @@ class WinPathTestCase(TestCase):
|
|||
Test to Returns the system path
|
||||
'''
|
||||
mock = MagicMock(return_value={'vdata': 'c:\\salt'})
|
||||
with patch.dict(win_path.__salt__, {'reg.read_key': mock}):
|
||||
with patch.dict(win_path.__salt__, {'reg.read_value': mock}):
|
||||
self.assertListEqual(win_path.get_path(), ['c:\\salt'])
|
||||
|
||||
def test_exists(self):
|
||||
|
|
Loading…
Add table
Reference in a new issue