diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2008-01-28 17:12:11 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2008-01-28 17:12:11 +0000 |
commit | e5a2454eeb1c692111e4a7235a1d49659593911c (patch) | |
tree | 965a8324e5e5092bbe1fe2c12db543a5c0e2aea2 | |
parent | 2e16fc762e014236105d51640f276b89d5d65be9 (diff) | |
download | bcfg2-e5a2454eeb1c692111e4a7235a1d49659593911c.tar.gz bcfg2-e5a2454eeb1c692111e4a7235a1d49659593911c.tar.bz2 bcfg2-e5a2454eeb1c692111e4a7235a1d49659593911c.zip |
Handle group coloring more robustly (Fixes issue reported by Matt Baker on irc) (analogous to r4295 in the stable branch)
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4296 ce84e21b-d406-0410-9b95-82705330c041
-rw-r--r-- | src/lib/Server/Admin/Viz.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/Server/Admin/Viz.py b/src/lib/Server/Admin/Viz.py index 85b6e8888..cac2de866 100644 --- a/src/lib/Server/Admin/Viz.py +++ b/src/lib/Server/Admin/Viz.py @@ -59,9 +59,11 @@ class Viz(Bcfg2.Server.Admin.Mode): instances = {} 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')] = self.colors.pop() + if not categories.has_key(group.get('category')): + categories[group.get('category')] = self.colors.pop() + group.set('color', categories[group.get('category')]) + if None in categories: + del categories[None] try: dotpipe.tochild.write("digraph groups {\n") @@ -98,7 +100,6 @@ class Viz(Bcfg2.Server.Admin.Mode): % (bundle, bundle)) gseen = [] for group in egroups: - color = categories[group.get('category', 'default')] if group.get('profile', 'false') == 'true': style = "filled, bold" else: @@ -106,7 +107,7 @@ class Viz(Bcfg2.Server.Admin.Mode): gseen.append(group.get('name')) dotpipe.tochild.write( '\t"group-%s" [label="%s", style="%s", fillcolor=%s];\n' % - (group.get('name'), group.get('name'), style, color)) + (group.get('name'), group.get('name'), style, group.get('color'))) if bundles: for bundle in group.findall('Bundle'): dotpipe.tochild.write('\t"group-%s" -> "bundle-%s";\n' % |