]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
orchestra/run: avoid usage of basestring for py3
authorKyr Shatskyy <kyrylo.shatskyy@suse.com>
Thu, 21 Nov 2019 13:55:38 +0000 (14:55 +0100)
committerKyr Shatskyy <kyrylo.shatskyy@gmail.com>
Thu, 21 Nov 2019 21:16:10 +0000 (22:16 +0100)
Signed-off-by: Kyr Shatskyy <kyrylo.shatskyy@suse.com>
teuthology/orchestra/run.py

index f5b46ff42f210ee0d6f45116ad8fe3970f4e6921..8992ec31b79043cf42398aad947c5d09abb0907c 100644 (file)
@@ -59,10 +59,10 @@ class RemoteProcess(object):
         """
         self.client = client
         self.args = args
-        if isinstance(args, basestring):
-            self.command = args
-        else:
+        if isinstance(args, list):
             self.command = quote(args)
+        else:
+            self.command = args
 
         if cwd:
             self.command = '(cd {cwd} && exec {cmd})'.format(
@@ -241,9 +241,6 @@ def quote(args):
     """
     Internal quote wrapper.
     """
-    if isinstance(args, basestring):
-        return args
-
     def _quote(args):
         """
         Handle quoted string, testing for raw charaters.
@@ -253,7 +250,10 @@ def quote(args):
                 yield a.value
             else:
                 yield pipes.quote(a)
-    return ' '.join(_quote(args))
+    if isinstance(args, list):
+        return ' '.join(_quote(args))
+    else:
+        return args
 
 
 def copy_to_log(f, logger, loglevel=logging.INFO, capture=None):