Simplify port specification.

For the moment, I've removed the ability to specify
a dict of options without using **. This is a slightly
unfortunate trade-off since it simplifies implementation
at the expense of making the API slightly less convenient
(if somewhat more consistent.)
This commit is contained in:
Bob Lantz
2012-03-25 15:39:18 -07:00
parent 2d924f8a65
commit e1246c3741
2 changed files with 54 additions and 79 deletions
+1 -5
View File
@@ -269,11 +269,7 @@ class Mininet( object ):
src, dst = self.nameToNode[ srcName ], self.nameToNode[ dstName ]
params = topo.linkInfo( srcName, dstName )
srcPort, dstPort = topo.port( srcName, dstName )
if not params:
params = {}
params.setdefault( 'port1', srcPort)
params.setdefault( 'port2', dstPort)
self.addLink( src, dst, **params )
self.addLink( src, dst, srcPort, dstPort, **params )
info( '(%s, %s) ' % ( src.name, dst.name ) )
info( '\n' )