From 318ae55e35279f41349abc3f610a9c80e107750c Mon Sep 17 00:00:00 2001 From: Bob Lantz Date: Tue, 20 Mar 2012 00:10:11 -0700 Subject: [PATCH] Allow sendCmd( [ cmd, arg1, ... ] ) --- mininet/node.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mininet/node.py b/mininet/node.py index 10a3b45..ad73ef5 100644 --- a/mininet/node.py +++ b/mininet/node.py @@ -194,8 +194,13 @@ class Node( object ): printPid: print command's PID?""" assert not self.waiting printPid = kwargs.get( 'printPid', True ) - if len( args ) > 0: + # Allow sendCmd( [ list ] ) + if len( args ) == 1 and type( args[ 0 ] ) is list: + cmd = args[ 0 ] + # Allow sendCmd( cmd, arg1, arg2... ) + elif len( args ) > 0: cmd = args + # Convert to string if not isinstance( cmd, str ): cmd = ' '.join( [ str( c ) for c in cmd ] ) if not re.search( r'\w', cmd ):