]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa: accept args as strings
authorRishabh Dave <ridave@redhat.com>
Thu, 21 Feb 2019 16:27:01 +0000 (21:57 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 12 Apr 2019 09:30:58 +0000 (15:00 +0530)
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 <ridave@redhat.com>
qa/tasks/vstart_runner.py

index b63e62965c0bb153010375e005f68ad88964474a..ece01701baf7f79065aebbc25ef096e36dfa2a87 100644 (file)
@@ -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