From: Jason Dillaman Date: Thu, 30 Nov 2017 19:03:56 +0000 (-0500) Subject: mgr/dashboard: utilize application metadata to detect RBD pools X-Git-Tag: v13.0.2~784^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=94bc0b904cedd1787aa6341ef3583d86ca0cd933;p=ceph.git mgr/dashboard: utilize application metadata to detect RBD pools Signed-off-by: Jason Dillaman --- diff --git a/src/pybind/mgr/dashboard/rbd_ls.py b/src/pybind/mgr/dashboard/rbd_ls.py index 87315a91bb41..ba27b3ab3d2d 100644 --- a/src/pybind/mgr/dashboard/rbd_ls.py +++ b/src/pybind/mgr/dashboard/rbd_ls.py @@ -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):