From: Rishabh Dave Date: Fri, 12 Apr 2024 11:04:04 +0000 (+0530) Subject: qa/cephfs: update filesystem.Filesystem.rank_fail() X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=efaecd20a3aef393521376b6106784b8a48d1630;p=ceph.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 f834ed9cc59..2e010018d4c 100644 --- a/qa/tasks/cephfs/filesystem.py +++ b/qa/tasks/cephfs/filesystem.py @@ -1067,8 +1067,13 @@ class Filesystem(MDSCluster): 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']