from emuvim.dcemulator.node import Datacenter, EmulatorCompute
from emuvim.dcemulator.resourcemodel import ResourceModelRegistrar
from emuvim.dcemulator.node import Datacenter, EmulatorCompute
from emuvim.dcemulator.resourcemodel import ResourceModelRegistrar
dc.net = self # set reference to network
self.dcs[label] = dc
dc.create() # finally create the data center in our Mininet instance
dc.net = self # set reference to network
self.dcs[label] = dc
dc.create() # finally create the data center in our Mininet instance
return dc
def addLink(self, node1, node2, **params):
return dc
def addLink(self, node1, node2, **params):
# 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:
# 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.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())
+ LOG.exception("No path could be found between {0} and {1}".format(vnf_src_name, vnf_dst_name))
+ LOG.debug("Graph nodes: %r" % self.DCNetwork_graph.nodes())
+ LOG.debug("Graph edges: %r" % self.DCNetwork_graph.edges())
return "Next node: {0} is not a switch".format(next_hop)
else:
# take first link between switches by default
return "Next node: {0} is not a switch".format(next_hop)
else:
# take first link between switches by default
req = urllib2.Request(url, str(data))
else:
req = urllib2.Request(url)
req = urllib2.Request(url, str(data))
else:
req = urllib2.Request(url)
- logging.info('error url: {0}'.format(str(url)))
- if data: logging.info('error POST: {0}'.format(str(data)))
+ LOG.info('error url: {0}'.format(str(url)))
+ if data: LOG.info('error POST: {0}'.format(str(data)))
# need to respect that some match fields must be integers
# http://ryu.readthedocs.io/en/latest/app/ofctl_rest.html#description-of-match-and-actions
# need to respect that some match fields must be integers
# http://ryu.readthedocs.io/en/latest/app/ofctl_rest.html#description-of-match-and-actions