Modify CephManager.run_cluster_cmd() to accept command arguments as
string as well since typing commands as strings is much lesser effort
than typing as list. This brings the interface a step closer to
teuthology.orchestra.remote.run()'s interface since it too can accept
commands arguments as string.
The change in cephfs_test_case.py is just to allow testing this PR
locally and on teuthology.
Signed-off-by: Rishabh Dave <ridave@redhat.com>
Accepts arguments same as that of teuthology.orchestra.run.run()
"""
+ if isinstance(kwargs['args'], str):
+ kwargs['args'] = shlex.split(kwargs['args'])
+
if self.cephadm:
return shell(self.ctx, self.cluster, self.controller,
args=['ceph'] + list(kwargs['args']),
# In case anything is in the OSD blocklist list, clear it out. This is to avoid
# the OSD map changing in the background (due to blocklist expiry) while tests run.
try:
- self.mds_cluster.mon_manager.raw_cluster_cmd("osd", "blocklist", "clear")
+ self.mds_cluster.mon_manager.run_cluster_cmd(args="osd blocklist clear")
except CommandFailedError:
# Fallback for older Ceph cluster
blocklist = json.loads(self.mds_cluster.mon_manager.raw_cluster_cmd("osd",
import unittest
import platform
import logging
+import shlex
from unittest import suite, loader
Accepts arguments same as teuthology.orchestra.remote.run().
"""
+ if isinstance(kwargs['args'], str):
+ kwargs['args'] = shlex.split(kwargs['args'])
kwargs['args'] = [CEPH_CMD] + list(kwargs['args'])
return self.controller.run(**kwargs)