Closed twangboy closed 4 years ago
would this be screensaver specific? on Windows 10 1903 (minion 2019.2.2):
machine_inactivity_limit:
lgpo.set:
- computer_policy:
"Interactive logon: Machine inactivity limit": '300'
----------
ID: machine_inactivity_limit
Function: lgpo.set
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "C:\salt\bin\lib\site-packages\salt\state.py", line 1933, in call
**cdata['kwargs'])
File "C:\salt\bin\lib\site-packages\salt\loader.py", line 1951, in wrapper
return f(*args, **kwargs)
File "C:\salt\bin\lib\site-packages\salt\states\win_lgpo.py", line 267, in set_
hierarchical_return=False)
File "C:\salt\bin\lib\site-packages\salt\modules\win_lgpo.py", line 7784, in get
return_not_configured=return_not_configured))
File "C:\salt\bin\lib\site-packages\salt\modules\win_lgpo.py", line 6519, in _checkAllAdmxPolicies
for path_needed in unpathed_dict[policy_namespace]:
KeyError: 'Microsoft.Policies.WindowsDefender'
Started: 11:52:33.870000
Duration: 21585.0 ms
Changes:
----------
haven't looked deeply, but we still use 2018.3.4 in our environment, and I haven't been able to reproduce it for this policy or doing any of the steps listed
seems to be a regression introduced since that release
We've updated the Administrative Templates, maybe that's why you're not able to reproduce it. https://www.microsoft.com/en-us/download/details.aspx?id=57576
I'm also using win_lgpo files from this PR: https://github.com/saltstack/salt/pull/55431 I'll try with an earlier version of win_lgpo... perhaps I broke something. Then I should be able to do a diff and see where I went wrong. Hopefully, it will be that easy.
It was a regression... I was able to find it doing a git diff. Thanks @lomeroe
Description of Issue
A Group Policy setting that has an Element that is a text field is not retrieved by
lgpo.get
.Setup
Open
gpedit.msc
Navigate toUser Configuration\Administrative Templates\Control Panel\Personalization
SetForce specific screen saver
toEnabled
Set theScreen saver executable name
to any text valueSteps to Reproduce Issue
Run
salt-call --local lgpo.get user
The above policy will not be displayed in the list of configured policiesNow set the policy to
Disabled
Runsalt-call --local lgpo.get user
Now the above policy will be correctly displayed as disabledAn additional bug, set the policy back to
Enabled
Leave theScreen saver executable name
blank Runsalt-call --local lgpo.get user
Observe the following stacktrace:Versions Report
master branch