Skip to content

Commit

Permalink
qa/tasks/{ceph_manager.py,vstart_runner.py}: allow kwargs in raw_*
Browse files Browse the repository at this point in the history
Allow passing kwargs (like stdin=) to the local and teuthology
clusters when running tests

Signed-off-by: Dan Mick <[email protected]>
  • Loading branch information
dmick committed Jun 29, 2018
1 parent 29209a3 commit 7fc8714
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
9 changes: 4 additions & 5 deletions qa/tasks/ceph_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -1135,7 +1135,7 @@ def raw_cluster_cmd(self, *args):
)
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.
"""
Expand All @@ -1152,10 +1152,9 @@ def raw_cluster_cmd_result(self, *args):
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):
Expand Down
9 changes: 5 additions & 4 deletions qa/tasks/vstart_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,19 +552,20 @@ def run_ceph_w(self):
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):
Expand Down

0 comments on commit 7fc8714

Please sign in to comment.