From 7d842f20c0f2eb2fadc43da2497a3c12f6f408fd Mon Sep 17 00:00:00 2001 From: Tiago Melo Date: Thu, 10 May 2018 10:36:57 +0100 Subject: [PATCH] mgr/dashboard: Remove unused data from summary controller Signed-off-by: Tiago Melo --- qa/tasks/mgr/dashboard/test_summary.py | 4 ---- src/pybind/mgr/dashboard/controllers/summary.py | 17 ----------------- .../navigation/navigation.component.ts | 2 -- 3 files changed, 23 deletions(-) diff --git a/qa/tasks/mgr/dashboard/test_summary.py b/qa/tasks/mgr/dashboard/test_summary.py index bbd85a394f3..065e59db03d 100644 --- a/qa/tasks/mgr/dashboard/test_summary.py +++ b/qa/tasks/mgr/dashboard/test_summary.py @@ -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}) diff --git a/src/pybind/mgr/dashboard/controllers/summary.py b/src/pybind/mgr/dashboard/controllers/summary.py index 0bf21c881ba..f0e57efcb70 100644 --- a/src/pybind/mgr/dashboard/controllers/summary.py +++ b/src/pybind/mgr/dashboard/controllers/summary.py @@ -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(), diff --git a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts index 05727f1f0a6..d17c53df10e 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/core/navigation/navigation/navigation.component.ts @@ -8,7 +8,6 @@ import { SummaryService } from '../../../shared/services/summary.service'; }) export class NavigationComponent implements OnInit { summaryData: any; - rbdPools: Array = []; 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; }); } -- 2.39.5