From: Dan Mick Date: Thu, 28 Jun 2018 22:36:25 +0000 (-0700) Subject: qa/tasks/{ceph_manager.py,vstart_runner.py}: allow kwargs in raw_* X-Git-Tag: v14.0.1~947^2~3 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=7fc8714a27450823e49a86f9da4bcaa73bf7b8da;p=ceph.git 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 --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 758c7e1484173..e507782f13619 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -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): diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 048376f5acf8f..87e45e0f840bc 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -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):