|
|
@ -12,10 +12,22 @@ if len(sys.argv) > 1:
|
|
|
|
|
|
|
|
|
|
|
|
ref_topo = OspfFileTopologyProvider(ref_topo_file).get_topology()
|
|
|
|
ref_topo = OspfFileTopologyProvider(ref_topo_file).get_topology()
|
|
|
|
|
|
|
|
|
|
|
|
try:
|
|
|
|
def get_empty_topology():
|
|
|
|
cur_topo = BirdSocketTopologyProvider(instance='ospf1', area=0).get_topology()
|
|
|
|
from birdvisu.topo_v3 import TopologyV3
|
|
|
|
except OSError as e:
|
|
|
|
topo = TopologyV3()
|
|
|
|
raise NotImplementedError('Cannot create a mock topology atm') from e
|
|
|
|
topo.freeze()
|
|
|
|
|
|
|
|
return topo
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if len(sys.argv) > 2 and sys.argv[2] == '--no-bird':
|
|
|
|
|
|
|
|
cur_topo = get_empty_topology()
|
|
|
|
|
|
|
|
else:
|
|
|
|
|
|
|
|
try:
|
|
|
|
|
|
|
|
cur_topo = BirdSocketTopologyProvider(instance='ospf1', area=0).get_topology()
|
|
|
|
|
|
|
|
except OSError as e:
|
|
|
|
|
|
|
|
# I know this is not how you print exceptions.
|
|
|
|
|
|
|
|
print('Cannot get topology from BIRD: {e}')
|
|
|
|
|
|
|
|
print('Will provide an empty topology.')
|
|
|
|
|
|
|
|
cur_topo = get_empty_topology()
|
|
|
|
|
|
|
|
|
|
|
|
# Create combined topology
|
|
|
|
# Create combined topology
|
|
|
|
|
|
|
|
|
|
|
|