From 952c1b5d61ba2615893d250d43d14d806a17ec71 Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 6 Feb 2007 15:59:51 +0000 Subject: Fix bcfg2-admin viz for groups that are both included and directly in groups.xml git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2787 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-admin | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/sbin') diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin index 31c67b491..090be1c2d 100755 --- a/src/sbin/bcfg2-admin +++ b/src/sbin/bcfg2-admin @@ -284,7 +284,8 @@ def do_viz(args): dotpipe = popen2.Popen4("dot -Tpng") categories = {'default':'grey83'} instances = {} - for group in groups.findall('.//Groups/Group'): + egroups = groups.findall("Group") + groups.findall('.//Groups/Group') + for group in egroups: if group.get('category', False): if not categories.has_key(group.get('category')): categories[group.get('category')] = colors.pop() @@ -315,7 +316,7 @@ def do_viz(args): for bundle in bundles: dotpipe.tochild.write('''\t"bundle-%s" [ label="%s", shape="septagon"];\n''' % (bundle, bundle)) gseen = [] - for group in groups.findall('.//Groups/Group'): + for group in egroups: color = categories[group.get('category', 'default')] if group.get('profile', 'false') == 'true': style="filled, bold" @@ -329,7 +330,7 @@ def do_viz(args): dotpipe.tochild.write('\t"group-%s" -> "bundle-%s";\n' % (group.get('name'), bundle.get('name'))) - for group in groups.findall('.//Groups/Group'): + for group in egroups: for parent in group.findall('Group'): if parent.get('name') not in gseen: dotpipe.tochild.write('\t"group-%s" [label="%s", style="filled", fillcolor="grey83"];\n' % -- cgit v1.2.3-1-g7c22