From 304cf13f4988312a4ec6ac14fff79bc74737e3ee Mon Sep 17 00:00:00 2001 From: Richard Connon Date: Tue, 18 Feb 2014 14:46:49 +0000 Subject: support python 2.4 for default ACL checking in Lint --- src/lib/Bcfg2/Server/Lint/RequiredAttrs.py | 13 +++++++------ 1 file 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", -- cgit v1.2.3-1-g7c22