From: peusterm Date: Mon, 18 Jul 2016 07:03:46 +0000 (+0200) Subject: be more verbose is an exception occurs X-Git-Tag: v3.1~90^2~7^2~2 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=a664eb611376fd77083f101c849b1dde7fc8bea8;p=osm%2Fvim-emu.git be more verbose is an exception occurs --- diff --git a/src/emuvim/dcemulator/net.py b/src/emuvim/dcemulator/net.py index 0e3882c..adf17d4 100755 --- a/src/emuvim/dcemulator/net.py +++ b/src/emuvim/dcemulator/net.py @@ -314,7 +314,9 @@ class DCNetwork(Containernet): # 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)) diff --git a/src/emuvim/examples/sonata_y1_demo_topology_1.py b/src/emuvim/examples/sonata_y1_demo_topology_1.py index c5c9611..1792f88 100755 --- a/src/emuvim/examples/sonata_y1_demo_topology_1.py +++ b/src/emuvim/examples/sonata_y1_demo_topology_1.py @@ -43,7 +43,7 @@ logging.basicConfig(level=logging.INFO) 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") @@ -52,6 +52,7 @@ def create_topology1(): # 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)