# if all shortest paths are wanted, use: all_shortest_paths
path = nx.shortest_path(self.DCNetwork_graph, src_sw, dst_sw, weight=kwargs.get('weight'))
except:
- logging.info("No path could be found between {0} and {1}".format(vnf_src_name, vnf_dst_name))
+ logging.exception("No path could be found between {0} and {1}".format(vnf_src_name, vnf_dst_name))
+ logging.debug("Graph nodes: %r" % self.DCNetwork_graph.nodes())
+ logging.debug("Graph edges: %r" % self.DCNetwork_graph.edges())
return "No path could be found between {0} and {1}".format(vnf_src_name, vnf_dst_name)
logging.info("Path between {0} and {1}: {2}".format(vnf_src_name, vnf_dst_name, path))
def create_topology1():
# create topology
- net = DCNetwork(controller=RemoteController, monitor=False, enable_learning = False)
+ net = DCNetwork(controller=RemoteController, monitor=False, enable_learning=False)
dc1 = net.addDatacenter("dc1")
dc2 = net.addDatacenter("dc2")
s1 = net.addSwitch("s1")
# add the command line interface endpoint to each DC (REST API)
rapi1 = RestApiEndpoint("0.0.0.0", 5001)
+ rapi1.connectDCNetwork(net)
rapi1.connectDatacenter(dc1)
rapi1.connectDatacenter(dc2)
# run API endpoint server (in another thread, don't block)