summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorNarayan Desai <desai@mcs.anl.gov>2008-08-13 03:22:18 +0000
committerNarayan Desai <desai@mcs.anl.gov>2008-08-13 03:22:18 +0000
commitd412c787be47e53f7384cc91a92f29314526fce4 (patch)
tree3a6aca313105d056c5f31a03ed302719cbb17470 /src/lib
parentbd8efd295e7e28c8d8b6c76f818087ee27e7e23b (diff)
downloadbcfg2-d412c787be47e53f7384cc91a92f29314526fce4.tar.gz
bcfg2-d412c787be47e53f7384cc91a92f29314526fce4.tar.bz2
bcfg2-d412c787be47e53f7384cc91a92f29314526fce4.zip
Fix minestruct with -g (Resolves Ticket #593)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4876 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Server/Admin/Minestruct.py20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/lib/Server/Admin/Minestruct.py b/src/lib/Server/Admin/Minestruct.py
index b63bdd2b5..9463bbc0e 100644
--- a/src/lib/Server/Admin/Minestruct.py
+++ b/src/lib/Server/Admin/Minestruct.py
@@ -43,20 +43,12 @@ class Minestruct(Bcfg2.Server.Admin.StructureMode):
extra = self.statistics.GetExtra(client)
root = lxml.etree.Element("Base")
self.log.info("Found %d extra entries" % (len(extra)))
- if len(groups) == 0:
- for tag, name in extra:
- self.log.info("%s: %s" % (tag, name))
- lxml.etree.SubElement(root, tag, name=name)
- else:
- groups_root = lxml.etree.Element("Group", name=groups[0])
- root.append(groups_root)
- for i in range (1, len(groups)):
- temp = lxml.etree.Element("Group", name=groups[i])
- groups_root.append(temp)
- groups_root = temp
- for entry in extra:
- self.log.info("%s: %s" % (tag, name))
- lxml.etree.SubElement(groups_root, tag, name=name)
+ add_point = root
+ for g in groups:
+ add_point = lxml.etree.SubElement(add_point, "Group", name=g)
+ for tag, name in extra:
+ self.log.info("%s: %s" % (tag, name))
+ lxml.etree.SubElement(add_point, tag, name=name)
tree = lxml.etree.ElementTree(root)
if write_to_file == True: