From a93445c798e06d1828a546807bd610af3fd2e376 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Thu, 20 Aug 2015 22:22:28 +0000 Subject: [PATCH] Remove support for `d[efault]:` in entry permissions It is not documented in [the Ansible doc page][1] nor [the BSD setfacl man entry][2] (which means it might not be compatible with BSD) so removing it does not break the API. On the other hand, it does not conform with POSIX 1003.1e DRAFT STANDARD 17 according to the [Linux setfacl man entry][3] so safer to remove. Finally, the most important reason: in non POSIX 1003.e mode, only ACL entries without the permissions field are accepted, so having an optional field here is very much error-prone. [1]: http://docs.ansible.com/ansible/acl_module.html [2]: http://www.freebsd.org/cgi/man.cgi?format=html&query=setfacl(1) [3]: http://linuxcommand.org/man_pages/setfacl1.html --- lib/ansible/modules/files/acl.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/lib/ansible/modules/files/acl.py b/lib/ansible/modules/files/acl.py index 7d1b96b9e97..2bd27f621f3 100644 --- a/lib/ansible/modules/files/acl.py +++ b/lib/ansible/modules/files/acl.py @@ -128,17 +128,12 @@ def split_entry(entry): a = entry.split(':') a.reverse() - if len(a) == 3: - a.append(False) try: - p, e, t, d = a + p, e, t = a except ValueError, e: print "wtf?? %s => %s" % (entry, a) raise e - if d: - d = True - if t.startswith("u"): t = "user" elif t.startswith("g"): @@ -150,7 +145,7 @@ def split_entry(entry): else: t = None - return [d, t, e, p] + return [t, e, p] def build_entry(etype, entity, permissions=None): @@ -282,7 +277,7 @@ def main(): if state == 'absent' and entry.count(":") != 1: module.fail_json(msg="'entry' MUST have 2 sections divided by ':' when 'state=absent'.") - default, etype, entity, permissions = split_entry(entry) + etype, entity, permissions = split_entry(entry) changed = False msg = ""