diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-03-19 17:01:20 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-03-19 17:01:20 +0000 |
commit | a948f086182ed73eeb37dd939ba2b69604d203c2 (patch) | |
tree | 68942195cd31795cf6cb07b3f07f1d09c8553128 /src/lib/Server/Plugin.py | |
parent | 50017e71e2811f8c8b699a4da0bad22ee37a3c5a (diff) | |
download | bcfg2-a948f086182ed73eeb37dd939ba2b69604d203c2.tar.gz bcfg2-a948f086182ed73eeb37dd939ba2b69604d203c2.tar.bz2 bcfg2-a948f086182ed73eeb37dd939ba2b69604d203c2.zip |
Plugin.py: unify predicates
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5131 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugin.py')
-rw-r--r-- | src/lib/Server/Plugin.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py index d9133a7fc..a9c2c303e 100644 --- a/src/lib/Server/Plugin.py +++ b/src/lib/Server/Plugin.py @@ -277,8 +277,7 @@ class StructFile(XMLFileBacked): and not isinstance(item, lxml.etree._Comment)] for group in [item for item in worklist if item.tag == 'Group']: # if only python had forceable early-binding - if group.get('negate', 'false') == 'true' or - group.get('negate', 'false') == 'True': + if group.get('negate', 'false') in ['true', 'True']: cmd = "lambda x:'%s' not in x.groups and predicate(x)" else: cmd = "lambda x:'%s' in x.groups and predicate(x)" @@ -310,8 +309,7 @@ class INode: self.predicate = lambda x:True else: predicate = parent.predicate - if data.get('negate', 'false') == 'true' - data.get('negate', 'false') == 'True': + if data.get('negate', 'false') in ['true', 'True']: psrc = self.nraw else: psrc = self.raw |