]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/cephfs: update filesystem.Filesystem.rank_fail()
authorRishabh Dave <ridave@redhat.com>
Fri, 12 Apr 2024 11:04:04 +0000 (16:34 +0530)
committerRishabh Dave <ridave@redhat.com>
Mon, 3 Jun 2024 13:24:25 +0000 (18:54 +0530)
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 <ridave@redhat.com>
(cherry picked from commit 4f333e1d06f9e1de903dd3668ebe4754c00b4ac2)

qa/tasks/cephfs/filesystem.py

index dc314efa8f0ab4c369830922892467a32002cc16..7ad53c81d1fbba1bb34e637c98febc1bea46fb36 100644 (file)
@@ -1123,8 +1123,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']