Remove pchanges from win_dacl

This commit is contained in:
Ch3LL 2019-04-19 16:00:39 -04:00
parent 81b865f667
commit 538d5cf1c3
No known key found for this signature in database
GPG key ID: 132B55A7C13EFA73

View file

@ -2125,17 +2125,15 @@ def _check_perms(obj_name, obj_type, new_perms, cur_perms, access_mode, ret):
changes[user]['applies_to'] = applies_to
if changes:
if 'perms' not in ret['pchanges']:
ret['pchanges']['perms'] = {}
if 'perms' not in ret['changes']:
ret['changes']['perms'] = {}
for user in changes:
user_name = get_name(principal=user)
if __opts__['test'] is True:
if user not in ret['pchanges']['perms']:
ret['pchanges']['perms'][user] = {}
ret['pchanges']['perms'][user][access_mode] = changes[user][access_mode]
if user not in ret['changes']['perms']:
ret['changes']['perms'][user] = {}
ret['changes']['perms'][user][access_mode] = changes[user][access_mode]
else:
# Get applies_to
applies_to = None
@ -2291,7 +2289,6 @@ def check_perms(obj_name,
if not ret:
ret = {'name': obj_name,
'changes': {},
'pchanges': {},
'comment': [],
'result': True}
orig_comment = ''
@ -2305,7 +2302,7 @@ def check_perms(obj_name,
current_owner = get_owner(obj_name=obj_name, obj_type=obj_type)
if owner != current_owner:
if __opts__['test'] is True:
ret['pchanges']['owner'] = owner
ret['changes']['owner'] = owner
else:
try:
set_owner(obj_name=obj_name,
@ -2323,7 +2320,7 @@ def check_perms(obj_name,
if not inheritance == get_inheritance(obj_name=obj_name,
obj_type=obj_type):
if __opts__['test'] is True:
ret['pchanges']['inheritance'] = inheritance
ret['changes']['inheritance'] = inheritance
else:
try:
set_inheritance(
@ -2371,9 +2368,9 @@ def check_perms(obj_name,
user_name.lower() not in set(k.lower() for k in grant_perms):
if 'grant' in cur_perms['Not Inherited'][user_name]:
if __opts__['test'] is True:
if 'remove_perms' not in ret['pchanges']:
ret['pchanges']['remove_perms'] = {}
ret['pchanges']['remove_perms'].update(
if 'remove_perms' not in ret['changes']:
ret['changes']['remove_perms'] = {}
ret['changes']['remove_perms'].update(
{user_name: cur_perms['Not Inherited'][user_name]})
else:
if 'remove_perms' not in ret['changes']:
@ -2390,9 +2387,9 @@ def check_perms(obj_name,
user_name.lower() not in set(k.lower() for k in deny_perms):
if 'deny' in cur_perms['Not Inherited'][user_name]:
if __opts__['test'] is True:
if 'remove_perms' not in ret['pchanges']:
ret['pchanges']['remove_perms'] = {}
ret['pchanges']['remove_perms'].update(
if 'remove_perms' not in ret['changes']:
ret['changes']['remove_perms'] = {}
ret['changes']['remove_perms'].update(
{user_name: cur_perms['Not Inherited'][user_name]})
else:
if 'remove_perms' not in ret['changes']:
@ -2416,7 +2413,7 @@ def check_perms(obj_name,
ret['comment'] = '\n'.join(ret['comment'])
# Set result for test = True
if __opts__['test'] and (ret['changes'] or ret['pchanges']):
if __opts__['test'] and (ret['changes']):
ret['result'] = None
return ret