From: Kyr Shatskyy Date: Thu, 21 Nov 2019 13:55:38 +0000 (+0100) Subject: orchestra/run: avoid usage of basestring for py3 X-Git-Tag: 1.1.0~189^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f924c87fa0561b63a070a5600314666906e36fa6;p=teuthology.git orchestra/run: avoid usage of basestring for py3 Signed-off-by: Kyr Shatskyy --- diff --git a/teuthology/orchestra/run.py b/teuthology/orchestra/run.py index f5b46ff42..8992ec31b 100644 --- a/teuthology/orchestra/run.py +++ b/teuthology/orchestra/run.py @@ -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):