From ee940faafffe44dc63b5168bd650741ace5c7f89 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Thu, 21 Feb 2019 21:57:01 +0530 Subject: [PATCH] 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 --- qa/tasks/vstart_runner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index b63e62965c0..ece01701baf 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 -- 2.39.5