mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
qa: add ceph cmd helper
A more programmer friendly command to use. Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
This commit is contained in:
parent
c0907f99e8
commit
166bb4d551
@ -13,6 +13,7 @@ import logging
|
||||
import threading
|
||||
import traceback
|
||||
import os
|
||||
import shlex
|
||||
|
||||
from io import BytesIO, StringIO
|
||||
from subprocess import DEVNULL
|
||||
@ -1326,6 +1327,17 @@ class CephManager:
|
||||
except CommandFailedError:
|
||||
self.log('Failed to get pg_num from pool %s, ignoring' % pool)
|
||||
|
||||
def ceph(self, cmd, **kwargs):
|
||||
"""
|
||||
Simple Ceph admin command wrapper around run_cluster_cmd.
|
||||
"""
|
||||
|
||||
kwargs.pop('args', None)
|
||||
args = shlex.split(cmd)
|
||||
stdout = kwargs.pop('stdout', StringIO())
|
||||
stderr = kwargs.pop('stderr', StringIO())
|
||||
return self.run_cluster_cmd(args=args, stdout=stdout, stderr=stderr, **kwargs)
|
||||
|
||||
def run_cluster_cmd(self, **kwargs):
|
||||
"""
|
||||
Run a Ceph command and return the object representing the process
|
||||
|
Loading…
Reference in New Issue
Block a user