Removed unused param in add_link.

This commit is contained in:
Bob Lantz
2012-03-31 21:29:27 -07:00
parent 1dd3de0d04
commit 78606a35c9
+6 -6
View File
@@ -62,8 +62,8 @@ class Topo(object):
result = self.add_node(name, is_switch=True, **opts) result = self.add_node(name, is_switch=True, **opts)
return result return result
def add_link(self, node1, node2, port1=None, port2=None, def add_link(self, node1, node2, port1=None, port2=None,
*default, **opts): **opts):
"""node1, node2: nodes to link together """node1, node2: nodes to link together
port1, port2: ports (optional) port1, port2: ports (optional)
opts: link options (optional) opts: link options (optional)
@@ -147,7 +147,7 @@ class Topo(object):
"Return link metadata" "Return link metadata"
src, dst = self.sorted([src, dst]) src, dst = self.sorted([src, dst])
return self.link_info[(src, dst)] return self.link_info[(src, dst)]
def nodeInfo( self, name ): def nodeInfo( self, name ):
"Return metadata (dict) for node" "Return metadata (dict) for node"
info = self.node_info[ name ] info = self.node_info[ name ]
@@ -181,7 +181,7 @@ class SingleSwitchTopo(Topo):
self.add_link(host, switch) self.add_link(host, switch)
class SingleSwitchReversedTopo(SingleSwitchTopo): class SingleSwitchReversedTopo(Topo):
'''Single switch connected to k hosts, with reversed ports. '''Single switch connected to k hosts, with reversed ports.
The lowest-numbered host is connected to the highest-numbered port. The lowest-numbered host is connected to the highest-numbered port.
@@ -194,12 +194,12 @@ class SingleSwitchReversedTopo(SingleSwitchTopo):
@param k number of hosts @param k number of hosts
@param enable_all enables all nodes and switches? @param enable_all enables all nodes and switches?
''' '''
super(SingleSwitchTopo, self).__init__(**opts) super(SingleSwitchReversedTopo, self).__init__(**opts)
self.k = k self.k = k
switch = self.add_switch('s1') switch = self.add_switch('s1')
for h in irange(1, k): for h in irange(1, k):
host = self.add_host('h%s' % h) host = self.add_host('h%s' % h)
self.add_link(host, switch, self.add_link(host, switch,
port1=0, port2=(k - h + 1)) port1=0, port2=(k - h + 1))
class LinearTopo(Topo): class LinearTopo(Topo):