From: Rishabh Dave Date: Fri, 12 Apr 2024 11:04:04 +0000 (+0530) Subject: qa/cephfs: update filesystem.Filesystem.rank_fail() X-Git-Tag: testing/wip-lusov-testing-20240611.123850-squid~6^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=53de0f4455813d753be6d3ad042ed8f32719ab12;p=ceph-ci.git qa/cephfs: update filesystem.Filesystem.rank_fail() Since the command "ceph mds fail" now may require confirmation flag ("--yes-i-really-mean-it"), update this method to allow/disallow adding this flag to the command arguments. Signed-off-by: Rishabh Dave (cherry picked from commit 4f333e1d06f9e1de903dd3668ebe4754c00b4ac2) --- diff --git a/qa/tasks/cephfs/filesystem.py b/qa/tasks/cephfs/filesystem.py index cef55277b50..c07928ec32c 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -1144,8 +1144,13 @@ class FilesystemBase(MDSClusterBase): def rank_repaired(self, rank): self.run_ceph_cmd("mds", "repaired", "{}:{}".format(self.id, rank)) - def rank_fail(self, rank=0): - self.run_ceph_cmd("mds", "fail", "{}:{}".format(self.id, rank)) + def rank_fail(self, rank=0, confirm=True): + cmd = f'mds fail {self.id}:{rank}' + try: + self.run_ceph_cmd(args=cmd) + except CommandFailedError: + cmd += ' --yes--i-really-mean-it' + self.run_ceph_cmd(args=cmd) def rank_is_running(self, rank=0, status=None): name = self.get_rank(rank=rank, status=status)['name']