From 94bc0b904cedd1787aa6341ef3583d86ca0cd933 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Thu, 30 Nov 2017 14:03:56 -0500 Subject: [PATCH] mgr/dashboard: utilize application metadata to detect RBD pools Signed-off-by: Jason Dillaman --- src/pybind/mgr/dashboard/rbd_ls.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/pybind/mgr/dashboard/rbd_ls.py b/src/pybind/mgr/dashboard/rbd_ls.py index 87315a91bb41a..ba27b3ab3d2d2 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): -- 2.39.5