summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2/Client/Tools/POSIX
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-19 10:28:12 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-10-19 10:28:18 -0400
commitb26f7e2012be9c0ad6f192bc50b16df4b938536b (patch)
treea49f066ffaf162eb1ef2e10dc6e473f70c3883cd /src/lib/Bcfg2/Client/Tools/POSIX
parent4d1e8397e167163023df83f6ddddb34ccca4a824 (diff)
downloadbcfg2-b26f7e2012be9c0ad6f192bc50b16df4b938536b.tar.gz
bcfg2-b26f7e2012be9c0ad6f192bc50b16df4b938536b.tar.bz2
bcfg2-b26f7e2012be9c0ad6f192bc50b16df4b938536b.zip
handle malformed ACL tags more elegantly
Diffstat (limited to 'src/lib/Bcfg2/Client/Tools/POSIX')
-rw-r--r--src/lib/Bcfg2/Client/Tools/POSIX/base.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/lib/Bcfg2/Client/Tools/POSIX/base.py b/src/lib/Bcfg2/Client/Tools/POSIX/base.py
index 5e851261b..35dc57612 100644
--- a/src/lib/Bcfg2/Client/Tools/POSIX/base.py
+++ b/src/lib/Bcfg2/Client/Tools/POSIX/base.py
@@ -334,7 +334,9 @@ class POSIXTool(Bcfg2.Client.Tools.Tool):
representing the permissions entailed by it. representations can
either be a single octal digit, a string of up to three 'r',
'w', 'x', or '-' characters, or a posix1e.Permset object"""
- if hasattr(perms, 'test'):
+ if perms is None:
+ return 0
+ elif hasattr(perms, 'test'):
# Permset object
return sum([p for p in ACL_MAP.values()
if perms.test(p)])
@@ -545,6 +547,10 @@ class POSIXTool(Bcfg2.Client.Tools.Tool):
self.logger.error("POSIX: Unknown ACL scope %s" %
acl.get("scope"))
continue
+ if acl.get('perms') is None:
+ self.logger.error("POSIX: No permissions set for ACL: %s" %
+ Bcfg2.Client.XML.tostring(acl))
+ continue
wanted[(acl.get("type"), scope, acl.get(acl.get("scope")))] = \
self._norm_acl_perms(acl.get('perms'))
return wanted