]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/cephfs: pass confirmation flag to fs fail in tear down code
authorRishabh Dave <ridave@redhat.com>
Mon, 25 Mar 2024 12:01:01 +0000 (17:31 +0530)
committerRishabh Dave <ridave@redhat.com>
Fri, 19 Apr 2024 11:46:47 +0000 (17:16 +0530)
Since "ceph fs fail" command now requires the confirmation flag when
Ceph cluster has either health warning MDS_TRIM or MDS_CACHE_OVERSIZE,
update tear down in QA code. During the teardown, the CephFS should be
failed, regardless of whether or not Ceph cluster has health warnings,
since it is teardown.

Signed-off-by: Rishabh Dave <ridave@redhat.com>
qa/tasks/cephfs/filesystem.py

index 3b0d1a66b7611d286bd9dc29d183df1a88f1025e..bf6adb8a1aa5e674756f8d7ea9c800ba0c4d9305 100644 (file)
@@ -605,7 +605,12 @@ class Filesystem(MDSCluster):
         self.run_ceph_cmd("fs", "reset", str(self.name), '--yes-i-really-mean-it')
 
     def fail(self):
-        self.run_ceph_cmd("fs", "fail", str(self.name))
+        cmd = ["fs", "fail", str(self.name)]
+        try:
+            self.run_ceph_cmd(cmd)
+        except CommandFailedError:
+            cmd.append("--yes-i-really-mean-it")
+            self.run_ceph_cmd(cmd)
 
     def set_flag(self, var, *args):
         a = map(lambda x: str(x).lower(), args)