summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-07-30 15:57:50 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-07-30 15:57:50 -0400
commitf9b6982372833351ea430c10e286d7c7f050ddff (patch)
tree7a7ccb7c5ab60df4d15a81fe5a8459a6da5fc3f5 /src
parentcf496740decef76942de27448b12d2150b53df0a (diff)
downloadbcfg2-f9b6982372833351ea430c10e286d7c7f050ddff.tar.gz
bcfg2-f9b6982372833351ea430c10e286d7c7f050ddff.tar.bz2
bcfg2-f9b6982372833351ea430c10e286d7c7f050ddff.zip
fixed StructFile.Match() when it encounters comments
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Plugin.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py
index 51d1b1cdb..696dacc06 100644
--- a/src/lib/Bcfg2/Server/Plugin.py
+++ b/src/lib/Bcfg2/Server/Plugin.py
@@ -678,6 +678,8 @@ class StructFile(XMLFileBacked):
def _include_element(self, item, metadata):
""" determine if an XML element matches the metadata """
+ if isinstance(item, lxml.etree._Comment):
+ return False
negate = item.get('negate', 'false').lower() == 'true'
if item.tag == 'Group':
return ((negate and item.get('name') not in metadata.groups) or
@@ -685,8 +687,6 @@ class StructFile(XMLFileBacked):
elif item.tag == 'Client':
return ((negate and item.get('name') != metadata.hostname) or
(not negate and item.get('name') == metadata.hostname))
- elif isinstance(item, lxml.etree._Comment):
- return False
else:
return True