diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 1fc11971f0f..9d9e735091e 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -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