mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fixed lint issues
This commit is contained in:
parent
fc724158de
commit
1c8e6e067f
@ -67,7 +67,7 @@ def setval(key, val, false_unsets=False, permanent=False):
|
||||
permanent_key = 'Environment'
|
||||
if permanent == 'HKLM':
|
||||
permanent_hive = 'HKLM'
|
||||
permanent_key = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
|
||||
permanent_key = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
|
||||
|
||||
if not isinstance(key, six.string_types):
|
||||
log.debug(
|
||||
|
@ -122,7 +122,7 @@ def setenv(name,
|
||||
permanent_key = 'Environment'
|
||||
if permanent == 'HKLM':
|
||||
permanent_hive = 'HKLM'
|
||||
permanent_key = 'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
|
||||
permanent_key = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
|
||||
|
||||
out = __salt__['reg.read_value'](permanent_hive, permanent_key, key)
|
||||
return out['success'] is True
|
||||
|
@ -57,15 +57,15 @@ class EnvironTestCase(TestCase):
|
||||
environ.__salt__['reg.delete_value'] = MagicMock()
|
||||
|
||||
environ.setval('key', 'Test', permanent=True)
|
||||
environ.__salt__['reg.set_value'].assert_called_with("HKCU", "Environment", 'key', 'Test')
|
||||
environ.__salt__['reg.set_value'].assert_called_with('HKCU', 'Environment', 'key', 'Test')
|
||||
|
||||
environ.setval('key', False, false_unsets=True, permanent=True)
|
||||
environ.__salt__['reg.set_value'].asset_not_called()
|
||||
environ.__salt__['reg.delete_value'].assert_called_with('HKCU', 'Environment', 'key')
|
||||
|
||||
key = "SYSTEM\CurrentControlSet\Control\Session Manager\Environment"
|
||||
environ.setval('key', 'Test', permanent="HKLM")
|
||||
environ.__salt__['reg.set_value'].assert_called_with("HKLM", key, 'key', 'Test')
|
||||
key = r'SYSTEM\CurrentControlSet\Control\Session Manager\Environment'
|
||||
environ.setval('key', 'Test', permanent='HKLM')
|
||||
environ.__salt__['reg.set_value'].assert_called_with('HKLM', key, 'key', 'Test')
|
||||
|
||||
def test_setenv(self):
|
||||
'''
|
||||
|
@ -9,9 +9,7 @@ from salttesting import TestCase
|
||||
from salttesting.helpers import ensure_in_syspath
|
||||
from salttesting.mock import (
|
||||
MagicMock,
|
||||
patch,
|
||||
NO_MOCK,
|
||||
NO_MOCK_REASON
|
||||
patch
|
||||
)
|
||||
ensure_in_syspath('../../')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user