summaryrefslogtreecommitdiffstats
path: root/src/lib/Bcfg2
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-10 11:36:27 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-10 11:36:27 -0400
commitd5ed9b3fd3a7f291841fef12e5992706f5d317ca (patch)
tree7c664736ac68a734c953f3728c4673439cfaf0a8 /src/lib/Bcfg2
parentbaad4ec996c599874364025590d9149f578ef99d (diff)
downloadbcfg2-d5ed9b3fd3a7f291841fef12e5992706f5d317ca.tar.gz
bcfg2-d5ed9b3fd3a7f291841fef12e5992706f5d317ca.tar.bz2
bcfg2-d5ed9b3fd3a7f291841fef12e5992706f5d317ca.zip
StructFile tests and fixes
Diffstat (limited to 'src/lib/Bcfg2')
-rw-r--r--src/lib/Bcfg2/Server/Plugin.py8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py
index e22eb508e..8ba19632d 100644
--- a/src/lib/Bcfg2/Server/Plugin.py
+++ b/src/lib/Bcfg2/Server/Plugin.py
@@ -706,11 +706,9 @@ class StructFile(XMLFileBacked):
return False
negate = item.get('negate', 'false').lower() == 'true'
if item.tag == 'Group':
- return ((negate and item.get('name') not in metadata.groups) or
- (not negate and item.get('name') in metadata.groups))
+ return negate == (item.get('name') not in metadata.groups)
elif item.tag == 'Client':
- return ((negate and item.get('name') != metadata.hostname) or
- (not negate and item.get('name') == metadata.hostname))
+ return negate == (item.get('name') != metadata.hostname)
else:
return True
@@ -724,7 +722,7 @@ class StructFile(XMLFileBacked):
rv.extend(self._match(child, metadata))
return rv
else:
- rv = copy.copy(item)
+ rv = copy.deepcopy(item)
for child in rv.iterchildren():
rv.remove(child)
for child in item.iterchildren():