summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Connon <richard@connon.me.uk>2014-02-18 14:46:49 +0000
committerRichard Connon <richard@connon.me.uk>2014-02-18 14:46:49 +0000
commit304cf13f4988312a4ec6ac14fff79bc74737e3ee (patch)
tree90a3252a96e1081fb4b18620069c53c32305655d
parentb63d4e12333b229948ea53703213b97275d790bd (diff)
downloadbcfg2-304cf13f4988312a4ec6ac14fff79bc74737e3ee.tar.gz
bcfg2-304cf13f4988312a4ec6ac14fff79bc74737e3ee.tar.bz2
bcfg2-304cf13f4988312a4ec6ac14fff79bc74737e3ee.zip
support python 2.4 for default ACL checking in Lint
-rw-r--r--src/lib/Bcfg2/Server/Lint/RequiredAttrs.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
index bb0d6956a..1d12ee461 100644
--- a/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
+++ b/src/lib/Bcfg2/Server/Lint/RequiredAttrs.py
@@ -139,12 +139,13 @@ class RequiredAttrs(Bcfg2.Server.Lint.ServerPlugin):
def check_default_acl(self, path):
""" Check that a default ACL contains either no entries or minimum
required entries """
- defaults = 1 if path.xpath(
- "ACL[@type='default' and @scope='user' and @user='']") else 0
- defaults += 1 if path.xpath(
- "ACL[@type='default' and @scope='group' and @group='']") else 0
- defaults += 1 if path.xpath(
- "ACL[@type='default' and @scope='other']") else 0
+ defaults = 0
+ if path.xpath("ACL[@type='default' and @scope='user' and @user='']"):
+ defaults += 1
+ if path.xpath("ACL[@type='default' and @scope='group' and @group='']"):
+ defaults += 1
+ if path.xpath("ACL[@type='default' and @scope='other']"):
+ defaults += 1
if defaults > 0 and defaults < 3:
self.LintError(
"missing-elements",