]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/dashboard_v2: get rbd pool list using CephService
authorRicardo Dias <rdias@suse.com>
Wed, 21 Feb 2018 16:07:57 +0000 (16:07 +0000)
committerRicardo Dias <rdias@suse.com>
Mon, 5 Mar 2018 13:07:13 +0000 (13:07 +0000)
Signed-off-by: Ricardo Dias <rdias@suse.com>
src/pybind/mgr/dashboard_v2/controllers/dashboard.py

index 1ec3bd0d79c20621132d9c3f4847efe9c101f4de..21637f4f97862ba67ebaeb5ac1847af6acf3c4b7 100644 (file)
@@ -9,6 +9,7 @@ import time
 import cherrypy
 from mgr_module import CommandResult
 
+from ..services.ceph_service import CephService
 from ..tools import ApiController, AuthRequired, BaseController, NotificationQueue, ViewCache
 
 
@@ -56,10 +57,7 @@ class Dashboard(BaseController):
 
     @ViewCache()
     def _rbd_pool_ls(self):
-        osd_map = self.mgr.get("osd_map")
-        rbd_pools = [pool['pool_name'] for pool in osd_map['pools'] if
-                     'rbd' in pool.get('application_metadata', {})]
-        return rbd_pools
+        return [pool['pool_name'] for pool in CephService.get_pool_list('rbd')]
 
     @cherrypy.expose
     @cherrypy.tools.json_out()