summaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/lib/Server/Plugins/Base.py10
-rw-r--r--src/lib/Server/Plugins/Bundler.py10
2 files changed, 12 insertions, 8 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:
diff --git a/src/lib/Server/Plugins/Bundler.py b/src/lib/Server/Plugins/Bundler.py
index 86c52b9e2..4b357f121 100644
--- a/src/lib/Server/Plugins/Bundler.py
+++ b/src/lib/Server/Plugins/Bundler.py
@@ -3,7 +3,7 @@ __revision__ = '$Revision$'
from copy import deepcopy
from syslog import LOG_ERR, syslog
-from lxml.etree import Element, XML, XMLSyntaxError
+from lxml.etree import Element, XML, XMLSyntaxError, _Comment
from Bcfg2.Server.Plugin import Plugin, SingleXMLFileBacked, XMLFileBacked, DirectoryBacked
@@ -50,11 +50,13 @@ class Bundle(XMLFileBacked):
self.all = []
self.systems = {}
self.attributes = {}
- for entry in xdata.getchildren():
+ for entry in [ent for ent in xdata.getchildren() if not isinstance(ent, _Comment)]:
if entry.tag == 'System':
- self.systems[entry.attrib['name']] = entry.getchildren()
+ self.systems[entry.attrib['name']] = [ent for ent in entry.getchildren() \
+ if not isinstance(ent, _Comment)]
elif entry.tag == 'Attribute':
- self.attributes[entry.get('name')] = entry.getchildren()
+ self.attributes[entry.get('name')] = [ent for ent in entry.getchildren() \
+ if not isinstance(ent, _Comment)]
else:
self.all.append(entry)
del self.data