mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #56290 from lorengordon/pop-secdata
Ensures popping lgpo.secedit_data does not throw KeyError
This commit is contained in:
commit
7701e8762d
2 changed files with 17 additions and 1 deletions
|
@ -5526,7 +5526,7 @@ def _write_secedit_data(inf_data):
|
|||
# Success
|
||||
if retcode == 0:
|
||||
# Pop secedit data so it will always be current
|
||||
__context__.pop('lgpo.secedit_data')
|
||||
__context__.pop('lgpo.secedit_data', None)
|
||||
return True
|
||||
# Failure
|
||||
return False
|
||||
|
|
|
@ -506,6 +506,22 @@ class WinLgpoTest(ModuleCase):
|
|||
'Not Configured',
|
||||
[r'; Source file: c:\\windows\\system32\\grouppolicy\\machine\\registry.pol[\s]*; PARSING COMPLETED.'])
|
||||
|
||||
@destructiveTest
|
||||
def test_set_computer_policy_GuestAccountStatus(self):
|
||||
'''
|
||||
Test setting/unsetting/changing GuestAccountStatus
|
||||
'''
|
||||
# disable GuestAccountStatus
|
||||
self._testSeceditPolicy(
|
||||
'GuestAccountStatus',
|
||||
'Disabled',
|
||||
[r'^EnableGuestAccount = 0'])
|
||||
# enable GuestAccountStatus
|
||||
self._testSeceditPolicy(
|
||||
'GuestAccountStatus',
|
||||
'Enabled',
|
||||
[r'^EnableGuestAccount = 1'])
|
||||
|
||||
@destructiveTest
|
||||
def test_set_computer_policy_PasswordComplexity(self):
|
||||
'''
|
||||
|
|
Loading…
Add table
Reference in a new issue