Skip to content

Commit d82900d

Browse files
committed
Don't look through all interfaces if you don't need to.
1 parent 2e19ceb commit d82900d

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

mininet/util.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,7 @@ def moveIntfNoRetry( intf, dstNode, srcNode=None, printError=False ):
188188
srcNode.cmd( cmd )
189189
else:
190190
quietRun( cmd )
191-
links = dstNode.cmd( 'ip link show' )
192-
if not ( ' %s:' % intf ) in links:
191+
if ( ' %s:' % intf ) not in dstNode.cmd( 'ip link show', intf ):
193192
if printError:
194193
error( '*** Error: moveIntf: ' + intf +
195194
' not successfully moved to ' + dstNode.name + '\n' )

0 commit comments

Comments
 (0)