mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix recursive cases on linux_acl.absent state
This commit is contained in:
parent
4a018490b8
commit
a0ed59dad9
2 changed files with 13 additions and 2 deletions
|
@ -210,7 +210,18 @@ def absent(name, acl_type, acl_name='', perms='', recurse=False):
|
|||
except (AttributeError, IndexError, StopIteration, KeyError):
|
||||
user = None
|
||||
|
||||
if user:
|
||||
need_refresh = False
|
||||
for path in __current_perms:
|
||||
acl_found = False
|
||||
for user_acl in __current_perms[path].get(_acl_type, []):
|
||||
if _search_name in user_acl:
|
||||
acl_found = True
|
||||
break
|
||||
if acl_found:
|
||||
need_refresh = True
|
||||
break
|
||||
|
||||
if user or need_refresh:
|
||||
ret['comment'] = 'Removing permissions'
|
||||
|
||||
if __opts__['test']:
|
||||
|
|
|
@ -234,7 +234,7 @@ class LinuxAclTestCase(TestCase, LoaderModuleMockMixin):
|
|||
'changes': {}}
|
||||
|
||||
mock = MagicMock(side_effect=[
|
||||
{name: {acl_type: [{acl_name: {'octal': 'rwx'}}]}, name+"/foo": {acl_type: [{acl_name: {'octal': 'A'}}]}}
|
||||
{name: {acl_type: [{acl_name: {'octal': 7}}]}, name+"/foo": {acl_type: [{acl_name: {'octal': 'A'}}]}}
|
||||
])
|
||||
with patch.dict(linux_acl.__salt__, {'acl.getfacl': mock}):
|
||||
with patch.dict(linux_acl.__opts__, {'test': True}):
|
||||
|
|
Loading…
Add table
Reference in a new issue