]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: utilize application metadata to detect RBD pools
authorJason Dillaman <dillaman@redhat.com>
Thu, 30 Nov 2017 19:03:56 +0000 (14:03 -0500)
committerJason Dillaman <dillaman@redhat.com>
Wed, 13 Dec 2017 15:41:07 +0000 (10:41 -0500)
Signed-off-by: Jason Dillaman <dillaman@redhat.com>
src/pybind/mgr/dashboard/rbd_ls.py

index 87315a91bb41a11482e3de84d17c1ce5eaf6cc46..ba27b3ab3d2d2a6b8f19b4d20dac4a70f49270f5 100644 (file)
@@ -10,20 +10,8 @@ class RbdPoolLs(RemoteViewCache):
 
 
         osd_map = self._module.get_sync_object(OsdMap).data
-        osd_pools = [pool['pool_name'] for pool in osd_map['pools']]
-
-        rbd_pools = []
-        for pool in osd_pools:
-            self.log.debug("Constructing IOCtx " + pool)
-            try:
-                ioctx = self._module.rados.open_ioctx(pool)
-                ioctx.stat("rbd_directory")
-                rbd_pools.append(pool)
-            except (rados.PermissionError, rados.ObjectNotFound):
-                self.log.debug("No RBD directory in " + pool)
-            except:
-                self.log.exception("Failed to open pool " + pool)
-
+        rbd_pools = [pool['pool_name'] for pool in osd_map['pools'] if \
+                        'rbd' in pool.get('application_metadata', {})]
         return rbd_pools
 
 class RbdLs(RemoteViewCache):