Don't look through all interfaces if you don't need to.
This commit is contained in:
+1
-2
@@ -188,8 +188,7 @@ def moveIntfNoRetry( intf, dstNode, srcNode=None, printError=False ):
|
|||||||
srcNode.cmd( cmd )
|
srcNode.cmd( cmd )
|
||||||
else:
|
else:
|
||||||
quietRun( cmd )
|
quietRun( cmd )
|
||||||
links = dstNode.cmd( 'ip link show' )
|
if ( ' %s:' % intf ) not in dstNode.cmd( 'ip link show', intf ):
|
||||||
if not ( ' %s:' % intf ) in links:
|
|
||||||
if printError:
|
if printError:
|
||||||
error( '*** Error: moveIntf: ' + intf +
|
error( '*** Error: moveIntf: ' + intf +
|
||||||
' not successfully moved to ' + dstNode.name + '\n' )
|
' not successfully moved to ' + dstNode.name + '\n' )
|
||||||
|
|||||||
Reference in New Issue
Block a user