Updated acl.modfacl to raise any error encountered

This commit is contained in:
Alexandru Bleotu 2017-07-10 11:29:46 +01:00
parent 4d5aedca62
commit 17447bf8c9

View File

@ -213,8 +213,10 @@ def modfacl(acl_type, acl_name='', perms='', *args, **kwargs):
salt '*' acl.modfacl d:u myuser 7 /tmp/house/kitchen
salt '*' acl.modfacl g mygroup 0 /tmp/house/kitchen /tmp/house/livingroom
salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen recursive=True
salt '*' acl.modfacl user myuser rwx /tmp/house/kitchen raise_err=True
'''
recursive = kwargs.pop('recursive', False)
raise_err = kwargs.pop('raise_err', False)
_raise_on_no_files(*args)
@ -228,7 +230,7 @@ def modfacl(acl_type, acl_name='', perms='', *args, **kwargs):
for dentry in args:
cmd += ' "{0}"'.format(dentry)
__salt__['cmd.run'](cmd, python_shell=False)
__salt__['cmd.run'](cmd, python_shell=False, raise_err=raise_err)
return True