]> git.apps.os.sepia.ceph.com Git - ceph.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:46:11 +0000 (19:16 +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 cef55277b5055bccbfe3754249d1bf15aa120adb..c07928ec32cae3ed57a3eecb4e39dd9ed5c307fb 100644 (file)
@@ -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']