Skip to content
Snippets Groups Projects
Commit 6008f987 authored by lantz's avatar lantz
Browse files

Merge pull request #436 from cdburkard/patches/plot

fix plot command to work when standard classes are present
parents 635e8f11 0676346a
No related branches found
No related tags found
No related merge requests found
......@@ -53,8 +53,8 @@ def do_plot( self, line ):
pos = nx.graphviz_layout( g )
opts = { 'ax': None, 'font_weight': 'bold',
'width': 2, 'edge_color': 'darkblue' }
hcolors = [ color[ h.server ] for h in hosts ]
scolors = [ color[ s.server ] for s in switches ]
hcolors = [ color[ getattr( h, 'server', 'localhost' ) ] for h in hosts ]
scolors = [ color[ getattr( s, 'server', 'localhost' ) ] for s in switches ]
nx.draw_networkx( g, pos=pos, nodelist=hosts, node_size=800, label='host',
node_color=hcolors, node_shape='s', **opts )
nx.draw_networkx( g, pos=pos, nodelist=switches, node_size=1000,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment