From: Rishabh Dave Date: Mon, 24 Jan 2022 18:49:11 +0000 (+0530) Subject: qa/ceph_manager: clean up CephManager.do_rados() X-Git-Tag: v18.0.0~353^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=970336997928592c0cecf925481b822c4e1246c1;p=ceph.git qa/ceph_manager: clean up CephManager.do_rados() do_rados() prefixes extra arguments to every command because they are helpful during execution of tests with teuthology. This patch eliminates these extra arguments entirely (through overriding) for test executions with vstart_runner.py. Note: "timeout 120" is now prefixed to rados commands too. AFAIS, it shouldn't have any side-effects on anything. This commit is similar to commit 93677576c1fd6d0e4e2991a9ba6be6d222ea98ea. Signed-off-by: Rishabh Dave --- diff --git a/qa/tasks/ceph_manager.py b/qa/tasks/ceph_manager.py index 51d802cd7ce..dd15315f0b9 100644 --- a/qa/tasks/ceph_manager.py +++ b/qa/tasks/ceph_manager.py @@ -22,6 +22,7 @@ from teuthology import misc as teuthology from tasks.scrub import Scrubber from tasks.util.rados import cmd_erasure_code_profile from tasks.util import get_remote + from teuthology.contextutil import safe_while from teuthology.orchestra.remote import Remote from teuthology.orchestra import run @@ -1534,10 +1535,12 @@ class CephManager: self.rook = rook self.cephadm = cephadm self.testdir = teuthology.get_testdir(self.ctx) - self.run_cluster_cmd_prefix = [ - 'sudo', 'adjust-ulimits', 'ceph-coverage', - f'{self.testdir}/archive/coverage', 'timeout', '120', 'ceph', - '--cluster', self.cluster] + # prefix args for ceph cmds to be executed + pre = ['adjust-ulimits', 'ceph-coverage', + f'{self.testdir}/archive/coverage'] + self.CEPH_CMD = ['sudo'] + pre + ['timeout', '120', 'ceph', + '--cluster', self.cluster] + self.RADOS_CMD = pre + ['rados', '--cluster', self.cluster] self.run_ceph_w_prefix = ['sudo', 'daemon-helper', 'kill', 'ceph', '--cluster', self.cluster] @@ -1584,7 +1587,7 @@ class CephManager: stdout=StringIO(), check_status=kwargs.get('check_status', True)) - kwargs['args'] = self.run_cluster_cmd_prefix + kwargs['args'] + kwargs['args'] = self.CEPH_CMD + kwargs['args'] return self.controller.run(**kwargs) def raw_cluster_cmd(self, *args, **kwargs) -> str: @@ -1719,14 +1722,7 @@ class CephManager: if remote is None: remote = self.controller - pre = [ - 'adjust-ulimits', - 'ceph-coverage', - f'{self.testdir}/archive/coverage', - 'rados', - '--cluster', - self.cluster, - ] + pre = self.RADOS_CMD + [] # deep-copying! if pool is not None: pre += ['--pool', pool] if namespace is not None: diff --git a/qa/tasks/vstart_runner.py b/qa/tasks/vstart_runner.py index 42a9f867c27..70e2dd147f7 100644 --- a/qa/tasks/vstart_runner.py +++ b/qa/tasks/vstart_runner.py @@ -191,6 +191,7 @@ else: SRC_PREFIX = "./" CEPH_CMD = os.path.join(BIN_PREFIX, 'ceph') +RADOS_CMD = os.path.join(BIN_PREFIX, 'rados') def rm_nonascii_chars(var): @@ -754,6 +755,8 @@ class LocalCephManager(CephManager): self.rook = False self.testdir = None self.run_ceph_w_prefix = self.run_cluster_cmd_prefix = [CEPH_CMD] + self.CEPH_CMD = [CEPH_CMD] + self.RADOS_CMD = [RADOS_CMD] def find_remote(self, daemon_type, daemon_id): """