summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2011-06-15 15:26:53 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2011-06-15 15:26:53 -0400
commit707a17cf8bcf0e91a2c74f671f0d3fffff3c294e (patch)
tree0ea044b21ec647f1fefc91ee7e97d9d194038021 /src/lib
parentdfee52f047c4d50b9b7120b4310c11397d1a0620 (diff)
downloadbcfg2-707a17cf8bcf0e91a2c74f671f0d3fffff3c294e.tar.gz
bcfg2-707a17cf8bcf0e91a2c74f671f0d3fffff3c294e.tar.bz2
bcfg2-707a17cf8bcf0e91a2c74f671f0d3fffff3c294e.zip
fixed bugs with handling of negate in new StructFile.Match()
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Plugin.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib/Server/Plugin.py b/src/lib/Server/Plugin.py
index e535802c7..740de247a 100644
--- a/src/lib/Server/Plugin.py
+++ b/src/lib/Server/Plugin.py
@@ -470,7 +470,8 @@ class StructFile(XMLFileBacked):
rv = []
if ((item.get('negate', 'false').lower() == 'true' and
item.get('name') not in metadata.groups) or
- item.get('name') in metadata.groups):
+ (item.get('negate', 'false').lower() == 'false' and
+ item.get('name') in metadata.groups)):
for child in item.iterchildren():
rv.extend(self._match(child, metadata))
return rv
@@ -478,7 +479,8 @@ class StructFile(XMLFileBacked):
rv = []
if ((item.get('negate', 'false').lower() == 'true' and
item.get('name') != metadata.hostname) or
- item.get('name') == metadata.hostname):
+ (item.get('negate', 'false').lower() == 'false' and
+ item.get('name') == metadata.hostname)):
for child in item.iterchildren():
rv.extend(self._match(child, metadata))
return rv