]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Let execute() accept a string for args.
authorZack Cerza <zack@cerza.org>
Wed, 4 Sep 2013 17:16:12 +0000 (12:16 -0500)
committerZack Cerza <zack@cerza.org>
Thu, 5 Sep 2013 21:55:38 +0000 (16:55 -0500)
teuthology/orchestra/run.py

index a3edc0ea55c4e9fcd2e772a067fcc739d4d4ee47..7bc5047668851c2b4c8ecba1a834cfb29c27ac21 100644 (file)
@@ -41,6 +41,7 @@ def quote(args):
                 yield pipes.quote(a)
     return ' '.join(_quote(args))
 
+
 def execute(client, args):
     """
     Execute a command remotely.
@@ -49,13 +50,16 @@ def execute(client, args):
 
     :param client: SSHConnection to run the command with
     :param args: command to run
-    :type args: list of string
+    :type args: string or list of strings
 
     Returns a RemoteProcess, where exitstatus is a callable that will
     block until the exit status is available.
     """
-    cmd = quote(args)
-    (host,port) = client.get_transport().getpeername()
+    if isinstance(args, basestring):
+        cmd = args
+    else:
+        cmd = quote(args)
+    (host, port) = client.get_transport().getpeername()
     log.debug('Running [{h}]: {cmd!r}'.format(h=host, cmd=cmd))
     (in_, out, err) = client.exec_command(cmd)