]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/util: add function to list all fs names
authorMilind Changire <mchangir@redhat.com>
Mon, 28 Feb 2022 06:22:26 +0000 (11:52 +0530)
committerMilind Changire <mchangir@redhat.com>
Thu, 24 Mar 2022 12:31:44 +0000 (18:01 +0530)
Signed-off-by: Milind Changire <mchangir@redhat.com>
src/pybind/mgr/mgr_util.py

index 949209e992ab12bac4731b042478d82a87c5359f..8d4f1b238248ca6802950b190d6a23f51c39f483 100644 (file)
@@ -321,6 +321,15 @@ class CephfsClient(Generic[Module_T]):
             return fs['mdsmap']['metadata_pool']
         return None
 
+    def get_all_filesystems(self) -> List[str]:
+        fs_list: List[str] = []
+        fs_map = self.mgr.get('fs_map')
+        if fs_map['filesystems']:
+            for fs in fs_map['filesystems']:
+                fs_list.append(fs['mdsmap']['fs_name'])
+        return fs_list
+
+
 
 @contextlib.contextmanager
 def open_filesystem(fsc: CephfsClient, fs_name: str) -> Generator["cephfs.LibCephFS", None, None]: