From: Rishabh Dave Date: Thu, 21 Feb 2019 16:27:01 +0000 (+0530) Subject: qa: accept args as strings X-Git-Tag: v15.1.0~2911^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ee940faafffe44dc63b5168bd650741ace5c7f89;p=ceph.git qa: accept args as strings Till now the run() method in vstart_runner.py accepts commands only as a (Python) list. It is very inconvenient to write commands as ['setfacl', '-m', 'user:someuser:rwx', 'somedir/somefile'] when they can be simply be written as 'setfacl -m user:someuser:rwx somedir/somefile'. Also, converting the latter form to former one is exceedingly simple. So writing commands as strings should be allowed. Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index b63e62965c0b..ece01701baf7 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -237,6 +237,9 @@ class LocalRemote(object): def run(self, args, check_status=True, wait=True, stdout=None, stderr=None, cwd=None, stdin=None, logger=None, label=None, env=None, timeout=None, omit_sudo=True): + if str(type(args)).find('str') != -1: + args = args.split() + try: if args[args.index('sudo') + 1] in ['-u', 'passwd', 'chown']: omit_sudo = False