summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorChris St. Pierre <chris.a.st.pierre@gmail.com>2012-07-31 13:07:46 -0400
committerChris St. Pierre <chris.a.st.pierre@gmail.com>2012-08-01 11:28:25 -0400
commit48102749da485d576b80fff13339886785519c49 (patch)
tree374aca8b5083dc4c51117856f8588575673b5862 /src
parent0d027cd104824975b0db7cbbe1cfd9c59d67c975 (diff)
downloadbcfg2-48102749da485d576b80fff13339886785519c49.tar.gz
bcfg2-48102749da485d576b80fff13339886785519c49.tar.bz2
bcfg2-48102749da485d576b80fff13339886785519c49.zip
made INode objects handle text contents and child elements correctly
Diffstat (limited to 'src')
-rw-r--r--src/lib/Bcfg2/Server/Plugin.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/Bcfg2/Server/Plugin.py b/src/lib/Bcfg2/Server/Plugin.py
index 18d4bb05d..0b620c2d2 100644
--- a/src/lib/Bcfg2/Server/Plugin.py
+++ b/src/lib/Bcfg2/Server/Plugin.py
@@ -797,11 +797,16 @@ class INode:
self.children.append(mytype(item, idict, self))
else:
try:
- self.contents[item.tag][item.get('name')] = item.attrib
+ self.contents[item.tag][item.get('name')] = \
+ dict(item.attrib)
except KeyError:
- self.contents[item.tag] = {item.get('name'): item.attrib}
+ self.contents[item.tag] = {item.get('name'): dict(item.attrib)}
if item.text:
- self.contents[item.tag]['__text__'] = item.text
+ self.contents[item.tag][item.get('name')]['__text__'] = \
+ item.text
+ if item.getchildren():
+ self.contents[item.tag][item.get('name')]['__children__'] =\
+ item.getchildren()
try:
idict[item.tag].append(item.get('name'))
except KeyError: