Skip to content

Isolating a node in sim mode rases exception

Created by: runborg

When a node is isolated with the linkfail command command pymetric throws a traceback and fail

(sim) >>> linkfail kake-gw2 stolav-gw3
Traceback (most recent call last):
  File "metrics.py", line 45, in <module>
    cli.cmdloop()
  File "/Users/runarb/src/metric/pymetric/command.py", line 64, in cmdloop
    Cmd.cmdloop(self)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/cmd.py", line 143, in cmdloop
    stop = self.postcmd(stop, line)
  File "/Users/runarb/src/metric/pymetric/command.py", line 86, in postcmd
    difflen = nx.average_shortest_path_length(self.simulation.graph)\
  File "/Library/Python/2.7/site-packages/networkx/algorithms/shortest_paths/generic.py", line 391, in average_shortest_path_length
    raise nx.NetworkXError("Graph is not weakly connected.")
networkx.exception.NetworkXError: Graph is not weakly connected.