]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/vstart_runner: update vstart_runner.LocalRemote.sh 33945/head
authorRishabh Dave <ridave@gmail.com>
Fri, 13 Mar 2020 07:03:50 +0000 (07:03 +0000)
committerRishabh Dave <ridave@redhat.com>
Mon, 30 Mar 2020 06:16:12 +0000 (11:46 +0530)
Commit 9f6c764f10f replaces remote.run calls by remote.sh without
updating the definition of vstart_runner.LocalRemote.sh which breaks the
cephfs tests when executed locally.

Fixes: https://tracker.ceph.com/issues/44579
Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/vstart_runner.py

index b14966a1de06d2a71acff6f0d644e62778126976..f19cd112aa5f847f2dc5f75019c4c6d10c4fb367 100644 (file)
@@ -389,12 +389,22 @@ class LocalRemote(object):
 
         return proc
 
-    def sh(self, command, log_limit=1024, cwd=None, env=None, **kwargs):
-        if isinstance(command, list):
-            command=' '.join(command)
+    # XXX: for compatibility keep this method same teuthology.orchestra.remote.sh
+    def sh(self, script, **kwargs):
+        """
+        Shortcut for run method.
+
+        Usage:
+            my_name = remote.sh('whoami')
+            remote_date = remote.sh('date')
+        """
+        if 'stdout' not in kwargs:
+            kwargs['stdout'] = BytesIO()
+        if 'args' not in kwargs:
+            kwargs['args'] = script
+        proc = self.run(**kwargs)
+        return proc.stdout.getvalue()
 
-        return misc.sh(command=command, log_limit=log_limit, cwd=cwd,
-                        env=env)
 
 class LocalDaemon(object):
     def __init__(self, daemon_type, daemon_id):