本文整理匯總了Python中mininet.net.Containernet.removeLink方法的典型用法代碼示例。如果您正苦於以下問題:Python Containernet.removeLink方法的具體用法?Python Containernet.removeLink怎麽用?Python Containernet.removeLink使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mininet.net.Containernet
的用法示例。
在下文中一共展示了Containernet.removeLink方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: removeLink
# 需要導入模塊: from mininet.net import Containernet [as 別名]
# 或者: from mininet.net.Containernet import removeLink [as 別名]
def removeLink(self, link=None, node1=None, node2=None):
"""
Remove the link from the Containernet and the networkx graph
"""
if link is not None:
node1 = link.intf1.node
node2 = link.intf2.node
assert node1 is not None
assert node2 is not None
Containernet.removeLink(self, link=link, node1=node1, node2=node2)
# TODO we might decrease the loglevel to debug:
try:
self.DCNetwork_graph.remove_edge(node2.name, node1.name)
except:
LOG.warning("%s, %s not found in DCNetwork_graph." % ((node2.name, node1.name)))
try:
self.DCNetwork_graph.remove_edge(node1.name, node2.name)
except:
LOG.warning("%s, %s not found in DCNetwork_graph." % ((node1.name, node2.name)))