From: Patrick Donnelly Date: Mon, 15 Jul 2019 20:09:06 +0000 (-0700) Subject: pybind/mgr/volumes: cleanup fs removal X-Git-Tag: v14.2.3~168^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0ecebbad97ffc13c1c614321d522efd0991a070d;p=ceph.git pybind/mgr/volumes: cleanup fs removal In Nautilus, the simplest sequence is: fs fail name fs rm name --yes-i-really-mean-it Signed-off-by: Patrick Donnelly (cherry picked from commit 7cc4b72305a895e99ae79e6a4d09f45c23a6257c) --- diff --git a/src/pybind/mgr/volumes/fs/volume.py b/src/pybind/mgr/volumes/fs/volume.py index d3fe6d99a41fe..e3e4501c25287 100644 --- a/src/pybind/mgr/volumes/fs/volume.py +++ b/src/pybind/mgr/volumes/fs/volume.py @@ -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