Skip to content

Commit

Permalink
qa/tasks: make sh() in vstart_runner.py identical with teuthology.orc…
Browse files Browse the repository at this point in the history
…hestra.remote.sh

Fixes: https://tracker.ceph.com/issues/46069
Signed-off-by: Jos Collin <jcollin@redhat.com>
  • Loading branch information
joscollin committed Jun 18, 2020
1 parent ae37135 commit a53fa39
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions qa/tasks/vstart_runner.py
Expand Up @@ -422,7 +422,7 @@ def _do_run(self, args, check_status=True, wait=True, stdout=None,

return proc

# XXX: for compatibility keep this method same teuthology.orchestra.remote.sh
# XXX: for compatibility keep this method same as teuthology.orchestra.remote.sh
def sh(self, script, **kwargs):
"""
Shortcut for run method.
Expand All @@ -432,12 +432,15 @@ def sh(self, script, **kwargs):
remote_date = remote.sh('date')
"""
if 'stdout' not in kwargs:
kwargs['stdout'] = StringIO()
kwargs['stdout'] = BytesIO()
if 'args' not in kwargs:
kwargs['args'] = script
proc = self.run(**kwargs)
return proc.stdout.getvalue()

out = proc.stdout.getvalue()
if isinstance(out, bytes):
return out.decode()
else:
return out

class LocalDaemon(object):
def __init__(self, daemon_type, daemon_id):
Expand Down

0 comments on commit a53fa39

Please sign in to comment.