be more verbose is an exception occurs
authorpeusterm <manuel.peuster@uni-paderborn.de>
Mon, 18 Jul 2016 07:03:46 +0000 (09:03 +0200)
committerpeusterm <manuel.peuster@uni-paderborn.de>
Mon, 18 Jul 2016 07:03:46 +0000 (09:03 +0200)
src/emuvim/dcemulator/net.py
src/emuvim/examples/sonata_y1_demo_topology_1.py

index 0e3882c..adf17d4 100755 (executable)
@@ -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))
index c5c9611..1792f88 100755 (executable)
@@ -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)