import threading
import traceback
import os
+import shlex
from io import BytesIO, StringIO
from subprocess import DEVNULL
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