From 7fc8714a27450823e49a86f9da4bcaa73bf7b8da Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 28 Jun 2018 15:36:25 -0700 Subject: [PATCH] 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 --- qa/tasks/ceph_manager.py | 9 ++++----- qa/tasks/vstart_runner.py | 9 +++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 758c7e148417..e507782f1361 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 048376f5acf8..87e45e0f840b 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): -- 2.47.3