Don't look through all interfaces if you don't need to.

This commit is contained in:
Bob Lantz
2014-03-06 17:52:41 -08:00
parent 2e19ceb0aa
commit d82900d3a8
+1 -2
View File
@@ -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' )