Skip to content
Snippets Groups Projects
Commit 78606a35 authored by Bob Lantz's avatar Bob Lantz
Browse files

Removed unused param in add_link.

parent 1dd3de0d
No related branches found
No related tags found
No related merge requests found
......@@ -62,8 +62,8 @@ def add_switch(self, name, **opts):
result = self.add_node(name, is_switch=True, **opts)
return result
def add_link(self, node1, node2, port1=None, port2=None,
*default, **opts):
def add_link(self, node1, node2, port1=None, port2=None,
**opts):
"""node1, node2: nodes to link together
port1, port2: ports (optional)
opts: link options (optional)
......@@ -147,7 +147,7 @@ def linkInfo( self, src, dst ):
"Return link metadata"
src, dst = self.sorted([src, dst])
return self.link_info[(src, dst)]
def nodeInfo( self, name ):
"Return metadata (dict) for node"
info = self.node_info[ name ]
......@@ -181,7 +181,7 @@ def __init__(self, k=2, **opts):
self.add_link(host, switch)
class SingleSwitchReversedTopo(SingleSwitchTopo):
class SingleSwitchReversedTopo(Topo):
'''Single switch connected to k hosts, with reversed ports.
The lowest-numbered host is connected to the highest-numbered port.
......@@ -194,12 +194,12 @@ def __init__(self, k=2, **opts):
@param k number of hosts
@param enable_all enables all nodes and switches?
'''
super(SingleSwitchTopo, self).__init__(**opts)
super(SingleSwitchReversedTopo, self).__init__(**opts)
self.k = k
switch = self.add_switch('s1')
for h in irange(1, k):
host = self.add_host('h%s' % h)
self.add_link(host, switch,
self.add_link(host, switch,
port1=0, port2=(k - h + 1))
class LinearTopo(Topo):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment