]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr/volumes: cleanup fs removal
authorPatrick Donnelly <pdonnell@redhat.com>
Mon, 15 Jul 2019 20:09:06 +0000 (13:09 -0700)
committerRamana Raja <rraja@redhat.com>
Wed, 17 Jul 2019 10:07:37 +0000 (15:37 +0530)
In Nautilus, the simplest sequence is:

    fs fail name
    fs rm name --yes-i-really-mean-it

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 7cc4b72305a895e99ae79e6a4d09f45c23a6257c)

src/pybind/mgr/volumes/fs/volume.py

index d3fe6d99a41fe862fd99b6e0679dd8eee0bd2bc2..e3e4501c252875420cba502226fd82867bbdc84c 100644 (file)
@@ -227,6 +227,10 @@ class VolumeClient(object):
         return self.mgr.mon_command(command)
 
     def remove_filesystem(self, fs_name):
+        command = {'prefix': 'fs fail', 'fs_name': fs_name}
+        r, outb, outs = self.mgr.mon_command(command)
+        if r != 0:
+            return r, outb, outs
         command = {'prefix': 'fs rm', 'fs_name': fs_name, 'yes_i_really_mean_it': True}
         return self.mgr.mon_command(command)
 
@@ -246,18 +250,6 @@ class VolumeClient(object):
             return -errno.EINVAL, "", str(e)
         return 0, "", ""
 
-    def set_mds_down(self, fs_name):
-        command = {'prefix': 'fs set', 'fs_name': fs_name, 'var': 'cluster_down', 'val': 'true'}
-        r, outb, outs = self.mgr.mon_command(command)
-        if r != 0:
-            return r, outb, outs
-        for mds in self.get_mds_names(fs_name):
-            command = {'prefix': 'mds fail', 'role_or_gid': mds}
-            r, outb, outs = self.mgr.mon_command(command)
-            if r != 0:
-                return r, outb, outs
-        return 0, "", ""
-
     ### volume operations -- create, rm, ls
 
     def create_volume(self, volname, size=None):
@@ -302,9 +294,6 @@ class VolumeClient(object):
         # In case orchestrator didn't tear down MDS daemons cleanly, or
         # there was no orchestrator, we force the daemons down.
         if self.volume_exists(volname):
-            r, outb, outs = self.set_mds_down(volname)
-            if r != 0:
-                return r, outb, outs
             r, outb, outs = self.remove_filesystem(volname)
             if r != 0:
                 return r, outb, outs