Skip to content
Snippets Groups Projects
Commit 8bc00379 authored by Bob Lantz's avatar Bob Lantz
Browse files

Fixed link check and updated quietRun interface.

Link check wasn't quite right - e.g. 'eth1' could be found in
'eth10' previously.

Updated quietRun to allow passing in args directly rather than
as a list.
parent 54dfb243
No related branches found
No related tags found
No related merge requests found
......@@ -17,9 +17,11 @@ def checkRun( cmd ):
cmd: list of command params"""
return check_call( cmd.split( ' ' ) )
def quietRun( cmd ):
def quietRun( *cmd ):
"""Run a command, routing stderr to stdout, and return the output.
cmd: list of command params"""
if len( cmd ) == 1:
cmd = cmd[ 0 ]
if isinstance( cmd, str ):
cmd = cmd.split( ' ' )
popen = Popen( cmd, stdout=PIPE, stderr=STDOUT )
......@@ -87,7 +89,7 @@ def moveIntfNoRetry( intf, node, printError=False ):
cmd = 'ip link set ' + intf + ' netns ' + repr( node.pid )
quietRun( cmd )
links = node.cmd( 'ip link show' )
if not intf in links:
if not ( ' %s:' % intf ) in links:
if printError:
lg.error( '*** Error: moveIntf: ' + intf +
' not successfully moved to ' + node.name + '\n' )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment