diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-07-30 15:57:50 -0400 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-07-30 15:57:50 -0400 |
commit | f9b6982372833351ea430c10e286d7c7f050ddff (patch) | |
tree | 7a7ccb7c5ab60df4d15a81fe5a8459a6da5fc3f5 /src/lib | |
parent | cf496740decef76942de27448b12d2150b53df0a (diff) | |
download | bcfg2-f9b6982372833351ea430c10e286d7c7f050ddff.tar.gz bcfg2-f9b6982372833351ea430c10e286d7c7f050ddff.tar.bz2 bcfg2-f9b6982372833351ea430c10e286d7c7f050ddff.zip |
fixed StructFile.Match() when it encounters comments
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Bcfg2/Server/Plugin.py | 4 |
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 |