Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix issues with lgpo state and util #50828

Merged
merged 3 commits into from Dec 13, 2018

Conversation

Projects
None yet
4 participants
@twangboy
Copy link
Contributor

commented Dec 11, 2018

What does this PR do?

Fix a py3 issue in the win_lgpo_netsh salt util. It didn't work at all on Py3
Make the state case insensitive for policy lookups. You can set them case-insensitive, but the state was case sensitive, causing test=True to report changes erroneously

Tests written?

No

Commits signed with GPG?

Yes/No

twangboy added some commits Dec 11, 2018

Fix issues with lgpo state and util
Fix py3 issues in win_lgpo_netsh
Make the state case insensitive for policy lookups
@@ -250,6 +251,9 @@ def set_(name,
for policy_section, policy_data in six.iteritems(pol_data):
pol_id = None
if policy_data and policy_data['output_section'] in current_policy:
# Make the subdict keys case insensitive
current_policy[policy_data['output_section']] = CaseInsensitiveDict(

This comment has been minimized.

Copy link
@cachedout

cachedout Dec 12, 2018

Collaborator

You could probably do this with salt.utils.dictupdate and avoid the import.

This comment has been minimized.

Copy link
@twangboy

twangboy Dec 12, 2018

Author Contributor

The purpose is to do a case-insensitive search of the dictionary keys. I don't see how to implement that with dictupdate. Am I missing something?

This comment has been minimized.

Copy link
@cachedout

cachedout Dec 12, 2018

Collaborator

You'd have to implement it on top of dictupdate. It's fine if you don't want to though. Either way works.

@dwoz

dwoz approved these changes Dec 12, 2018

@cachedout cachedout merged commit 6b45aad into saltstack:2018.3 Dec 13, 2018

10 checks passed

WIP Ready for review
Details
continuous-integration/jenkins/pr-merge This commit looks good
Details
jenkins/pr/docs The docs job has passed
Details
jenkins/pr/lint Python lint test has passed
Details
jenkins/pr/py2-centos-7 The py2-centos-7 job has passed
Details
jenkins/pr/py2-ubuntu-1604 The py2-ubuntu-1604 job has passed
Details
jenkins/pr/py2-windows-2016 The py2-windows-2016 job has passed
Details
jenkins/pr/py3-centos-7 The py3-centos-7 job has passed
Details
jenkins/pr/py3-ubuntu-1604 The py3-ubuntu-1604 job has passed
Details
jenkins/pr/py3-windows-2016 The py3-windows-2016 job has passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.