summaryrefslogtreecommitdiffstats
path: root/src/lib/Server/Plugins/Base.py
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2005-11-30 22:37:07 +0000
committerNarayan Desai <desai@mcs.anl.gov>2005-11-30 22:37:07 +0000
commitfd301199a094b99a1b9c261058647fd0a5af33f5 (patch)
treede892c3e2af188f7b46e0ab12958ea0a280a4533 /src/lib/Server/Plugins/Base.py
parentbe903a46517c393bbd3ee17bfaaaf7381a7f9d39 (diff)
downloadbcfg2-fd301199a094b99a1b9c261058647fd0a5af33f5.tar.gz
bcfg2-fd301199a094b99a1b9c261058647fd0a5af33f5.tar.bz2
bcfg2-fd301199a094b99a1b9c261058647fd0a5af33f5.zip
fix xml comments
(Logical change 1.376) git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@1588 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Server/Plugins/Base.py')
-rw-r--r--src/lib/Server/Plugins/Base.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/lib/Server/Plugins/Base.py b/src/lib/Server/Plugins/Base.py
index 71719263f..1cdd7599c 100644
--- a/src/lib/Server/Plugins/Base.py
+++ b/src/lib/Server/Plugins/Base.py
@@ -2,7 +2,7 @@
__revision__ = '$Revision$'
from copy import deepcopy
-from lxml.etree import Element, XML, XMLSyntaxError
+from lxml.etree import Element, XML, XMLSyntaxError, _Comment
from Bcfg2.Server.Plugin import Plugin, PluginInitError, SingleXMLFileBacked
@@ -30,13 +30,15 @@ class Base(Plugin, SingleXMLFileBacked):
self.LogError("Failed to parse base.xml")
return
self.store = {'all':[], 'Class':{'all':[]}, 'Image':{'all':[]}, 'all':[]}
- for entry in xdata.getchildren():
+ for entry in [ent for ent in xdata.getchildren() if not isinstance(ent, _Comment)]:
if entry.tag in ['Image', 'Class']:
if not self.store[entry.tag].has_key(entry.get('name')):
self.store[entry.tag][entry.get('name')] = {'all':[], 'Class':{}, 'Image':{}}
- for child in entry.getchildren():
+ for child in [ent for ent in entry.getchildren() if not isinstance(ent, _Comment)]:
if child.tag in ['Image', 'Class']:
- self.store[entry.tag][entry.get('name')][child.tag][child.get('name')] = child.getchildren()
+ self.store[entry.tag][entry.get('name')][child.tag][child.get('name')] = \
+ [ent for ent in child.getchildren() if \
+ not isinstance(ent, _Comment)]
else:
self.store[entry.tag][entry.get('name')]['all'].append(child)
else: