summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2007-02-16 21:48:22 +0000
committerNarayan Desai <desai@mcs.anl.gov>2007-02-16 21:48:22 +0000
commit6f73e672d16eb94d3bcf7e8392400f567cde4b5d (patch)
tree89cbb914a30f3a16b7f1dbf1675cca8d915b6d9d
parentbcadd1b89d852fbc5af48917be9c7e9a318e7306 (diff)
downloadbcfg2-6f73e672d16eb94d3bcf7e8392400f567cde4b5d.tar.gz
bcfg2-6f73e672d16eb94d3bcf7e8392400f567cde4b5d.tar.bz2
bcfg2-6f73e672d16eb94d3bcf7e8392400f567cde4b5d.zip
Handle non-elements in pkglists (Resolves Ticket #403)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2831 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r--src/lib/Server/Plugins/Pkgmgr.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/Server/Plugins/Pkgmgr.py b/src/lib/Server/Plugins/Pkgmgr.py
index 7dc7a1bd2..abf0f689b 100644
--- a/src/lib/Server/Plugins/Pkgmgr.py
+++ b/src/lib/Server/Plugins/Pkgmgr.py
@@ -17,8 +17,13 @@ class PNode(Bcfg2.Server.Plugin.INode):
if not pdict.has_key('Package'):
pdict['Package'] = []
for child in data.getchildren():
- for attr in [key for key in data.attrib.keys() if key != 'name' and not child.attrib.has_key(key)]:
- child.set(attr, data.get(attr))
+ for attr in [key for key in data.attrib.keys() \
+ if key != 'name' and not child.attrib.has_key(key)]:
+ try:
+ child.set(attr, data.get(attr))
+ except:
+ # don't fail on things like comments and other immutable elements
+ pass
Bcfg2.Server.Plugin.INode.__init__(self, data, pdict, parent)
if not self.contents.has_key('Package'):
self.contents['Package'] = {}