summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2011-01-24 11:04:55 -0600
committerTim Laszlo <tim.laszlo@gmail.com>2011-01-24 11:07:01 -0600
commitca6bf209b2a1c655fd5fa076ff0dc609ad066ca7 (patch)
treeee91c9965ee96385dac32177fd93bbdf4286ca5e
parent589d0dac3cacac9b813c38d6eff5f652f7df9029 (diff)
downloadbcfg2-ca6bf209b2a1c655fd5fa076ff0dc609ad066ca7.tar.gz
bcfg2-ca6bf209b2a1c655fd5fa076ff0dc609ad066ca7.tar.bz2
bcfg2-ca6bf209b2a1c655fd5fa076ff0dc609ad066ca7.zip
Metadata: Stop stripping comments from clients.xml (Resolves #929)
-rw-r--r--src/lib/Server/Plugins/Metadata.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/src/lib/Server/Plugins/Metadata.py b/src/lib/Server/Plugins/Metadata.py
index fb7455a4c..52ae10dff 100644
--- a/src/lib/Server/Plugins/Metadata.py
+++ b/src/lib/Server/Plugins/Metadata.py
@@ -285,7 +285,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
continue
else:
break
- tree.write(client_tree)
+ tree.write(client_tree, pretty_print=True)
fcntl.lockf(fd, fcntl.LOCK_UN)
client_tree.close()
@@ -307,7 +307,7 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
continue
else:
break
- tree.write(client_tree)
+ tree.write(client_tree, pretty_print=True)
fcntl.lockf(fd, fcntl.LOCK_UN)
client_tree.close()
@@ -500,14 +500,6 @@ class Metadata(Bcfg2.Server.Plugin.Plugin,
raise MetadataRuntimeError
# prep data
dataroot = self.clientdata_original.getroot()
- if hasattr(dataroot, 'iter'):
- items = dataroot.iter()
- else:
- items = dataroot.getchildren()
- for item in items:
- # no items have text data of any sort
- item.tail = None
- item.text = None
newcontents = lxml.etree.tostring(dataroot, pretty_print=True)
fd = datafile.fileno()