From 39203484a66f5722a7d1b02290d57e83346f380a Mon Sep 17 00:00:00 2001 From: Bob Lantz <rlantz@cs.stanford.edu> Date: Fri, 7 Nov 2014 13:42:50 -0800 Subject: [PATCH] Make port1, port2 truly optional and don't pass them to Link() --- mininet/net.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mininet/net.py b/mininet/net.py index 0102a2e6..fea14d4d 100755 --- a/mininet/net.py +++ b/mininet/net.py @@ -342,6 +342,10 @@ def addLink( self, node1, node2, port1=None, port2=None, options = dict( params ) options.setdefault( 'addr1', self.randMac() ) options.setdefault( 'addr2', self.randMac() ) + if port1 is not None: + options.setdefault( 'port1', port1 ) + if port2 is not None: + options.setdefault( 'port2', port2 ) cls = self.link if cls is None else cls link = cls( node1, node2, **options ) self.links.append( link ) -- GitLab