qa/tasks/{ceph_manager.py,vstart_runner.py}: allow kwargs in raw_*

Allow passing kwargs (like stdin=) to the local and teuthology
clusters when running tests

Signed-off-by: Dan Mick <dan.mick@redhat.com>
This commit is contained in:
Dan Mick 2018-06-28 15:36:25 -07:00
parent 29209a3ea8
commit 7fc8714a27
2 changed files with 9 additions and 9 deletions

View File

@ -1135,7 +1135,7 @@ class CephManager:
)
return proc.stdout.getvalue()
def raw_cluster_cmd_result(self, *args):
def raw_cluster_cmd_result(self, *args, **kwargs):
"""
Start ceph on a cluster. Return success or failure information.
"""
@ -1152,10 +1152,9 @@ class CephManager:
self.cluster,
]
ceph_args.extend(args)
proc = self.controller.run(
args=ceph_args,
check_status=False,
)
kwargs['args'] = ceph_args
kwargs['check_status'] = False
proc = self.controller.run(**kwargs)
return proc.exitstatus
def run_ceph_w(self):

View File

@ -552,19 +552,20 @@ class LocalCephManager(CephManager):
proc = self.controller.run([os.path.join(BIN_PREFIX, "ceph"), "-w"], wait=False, stdout=StringIO())
return proc
def raw_cluster_cmd(self, *args):
def raw_cluster_cmd(self, *args, **kwargs):
"""
args like ["osd", "dump"}
return stdout string
"""
proc = self.controller.run([os.path.join(BIN_PREFIX, "ceph")] + list(args))
proc = self.controller.run([os.path.join(BIN_PREFIX, "ceph")] + list(args), **kwargs)
return proc.stdout.getvalue()
def raw_cluster_cmd_result(self, *args):
def raw_cluster_cmd_result(self, *args, **kwargs):
"""
like raw_cluster_cmd but don't check status, just return rc
"""
proc = self.controller.run([os.path.join(BIN_PREFIX, "ceph")] + list(args), check_status=False)
kwargs['check_status'] = False
proc = self.controller.run([os.path.join(BIN_PREFIX, "ceph")] + list(args), **kwargs)
return proc.exitstatus
def admin_socket(self, daemon_type, daemon_id, command, check_status=True):