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:
+1
-5
@@ -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' )
|
||||
|
||||
Reference in New Issue
Block a user