mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix issues with lgpo state and util
Fix py3 issues in win_lgpo_netsh Make the state case insensitive for policy lookups
This commit is contained in:
parent
a8ad17aaa4
commit
56c0e55581
@ -114,6 +114,7 @@ import salt.utils.json
|
|||||||
|
|
||||||
# Import 3rd party libs
|
# Import 3rd party libs
|
||||||
from salt.ext import six
|
from salt.ext import six
|
||||||
|
from requests.structures import CaseInsensitiveDict
|
||||||
|
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
__virtualname__ = 'lgpo'
|
__virtualname__ = 'lgpo'
|
||||||
@ -250,6 +251,9 @@ def set_(name,
|
|||||||
for policy_section, policy_data in six.iteritems(pol_data):
|
for policy_section, policy_data in six.iteritems(pol_data):
|
||||||
pol_id = None
|
pol_id = None
|
||||||
if policy_data and policy_data['output_section'] in current_policy:
|
if policy_data and policy_data['output_section'] in current_policy:
|
||||||
|
# Make the subdict keys case insensitive
|
||||||
|
current_policy[policy_data['output_section']] = CaseInsensitiveDict(
|
||||||
|
current_policy[policy_data['output_section']])
|
||||||
for policy_name, policy_setting in six.iteritems(policy_data['requested_policy']):
|
for policy_name, policy_setting in six.iteritems(policy_data['requested_policy']):
|
||||||
currently_set = False
|
currently_set = False
|
||||||
if policy_name in current_policy[policy_data['output_section']]:
|
if policy_name in current_policy[policy_data['output_section']]:
|
||||||
|
@ -196,7 +196,7 @@ def get_settings(profile, section, store='local'):
|
|||||||
ret = {}
|
ret = {}
|
||||||
# Skip the first 2 lines. Add everything else to a dictionary
|
# Skip the first 2 lines. Add everything else to a dictionary
|
||||||
for line in results[3:]:
|
for line in results[3:]:
|
||||||
ret.update(dict(map(None, *[iter(re.split(r"\s{2,}", line))]*2))) # pylint: disable=incompatible-py3-code
|
ret.update(dict(zip(*[iter(re.split(r"\s{2,}", line))]*2)))
|
||||||
|
|
||||||
# Remove spaces from the values so that `Not Configured` is detected
|
# Remove spaces from the values so that `Not Configured` is detected
|
||||||
# correctly
|
# correctly
|
||||||
|
Loading…
Reference in New Issue
Block a user