From 53de0f4455813d753be6d3ad042ed8f32719ab12 Mon Sep 17 00:00:00 2001 From: Rishabh Dave Date: Fri, 12 Apr 2024 16:34:04 +0530 Subject: [PATCH] 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) --- qa/tasks/cephfs/filesystem.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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'] -- 2.39.5