]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Remove unused data from summary controller 21913/head
authorTiago Melo <tmelo@suse.com>
Thu, 10 May 2018 09:36:57 +0000 (10:36 +0100)
committerTiago Melo <tmelo@suse.com>
Thu, 31 May 2018 21:50:43 +0000 (22:50 +0100)
Signed-off-by: Tiago Melo <tmelo@suse.com>
qa/tasks/mgr/dashboard/test_summary.py
src/pybind/mgr/dashboard/controllers/summary.py
src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts

index bbd85a394f3e3ec7556e7a61fa04204cc9264e80..065e59db03d78b4cbcc1bc1f59ef43e55e3b07f7 100644 (file)
@@ -11,17 +11,13 @@ class SummaryTest(DashboardTestCase):
         data = self._get("/api/summary")
         self.assertStatus(200)
 
-        self.assertIn('filesystems', data)
         self.assertIn('health_status', data)
-        self.assertIn('rbd_pools', data)
         self.assertIn('mgr_id', data)
         self.assertIn('have_mon_connection', data)
         self.assertIn('rbd_mirroring', data)
         self.assertIn('executing_tasks', data)
         self.assertIn('finished_tasks', data)
-        self.assertIsNotNone(data['filesystems'])
         self.assertIsNotNone(data['health_status'])
-        self.assertIsNotNone(data['rbd_pools'])
         self.assertIsNotNone(data['mgr_id'])
         self.assertIsNotNone(data['have_mon_connection'])
         self.assertEqual(data['rbd_mirroring'], {'errors': 0, 'warnings': 0})
index 0bf21c881ba6e2a29d99e92a402028bd2d2dea5a..f0e57efcb703f740cdd5833ba7daa64d735c7a33 100644 (file)
@@ -7,31 +7,16 @@ from .. import mgr
 from . import AuthRequired, ApiController, Endpoint, BaseController
 from ..controllers.rbd_mirroring import get_daemons_and_pools
 from ..tools import ViewCacheNoDataException
-from ..services.ceph_service import CephService
 from ..tools import TaskManager
 
 
 @ApiController('/summary')
 @AuthRequired()
 class Summary(BaseController):
-    def _rbd_pool_data(self):
-        pool_names = [pool['pool_name'] for pool in CephService.get_pool_list('rbd')]
-        return sorted(pool_names)
-
     def _health_status(self):
         health_data = mgr.get("health")
         return json.loads(health_data["json"])['status']
 
-    def _filesystems(self):
-        fsmap = mgr.get("fs_map")
-        return [
-            {
-                "id": f['id'],
-                "name": f['mdsmap']['fs_name']
-            }
-            for f in fsmap['filesystems']
-        ]
-
     def _rbd_mirroring(self):
         try:
             _, data = get_daemons_and_pools()
@@ -59,9 +44,7 @@ class Summary(BaseController):
     def __call__(self):
         executing_t, finished_t = TaskManager.list_serializable()
         return {
-            'rbd_pools': self._rbd_pool_data(),
             'health_status': self._health_status(),
-            'filesystems': self._filesystems(),
             'rbd_mirroring': self._rbd_mirroring(),
             'mgr_id': mgr.get_mgr_id(),
             'have_mon_connection': mgr.have_mon_connection(),
index 05727f1f0a6e74c8a5a6be633c65882b2c3bb0db..d17c53df10e8fd5b4d24b0c72a3e493f2e4ec156 100644 (file)
@@ -8,7 +8,6 @@ import { SummaryService } from '../../../shared/services/summary.service';
 })
 export class NavigationComponent implements OnInit {
   summaryData: any;
-  rbdPools: Array<any> = [];
   isCollapsed = true;
 
   constructor(private summaryService: SummaryService) {}
@@ -16,7 +15,6 @@ export class NavigationComponent implements OnInit {
   ngOnInit() {
     this.summaryService.summaryData$.subscribe((data: any) => {
       this.summaryData = data;
-      this.rbdPools = data.rbd_pools;
     });
   }