From 9a4d379705483f5daea3af4a8283d84c1475eca8 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Mon, 23 Apr 2018 16:47:34 +0200 Subject: [PATCH] mgr/dashboard: Fix bug in RBD form. Signed-off-by: Volker Theile --- qa/tasks/mgr/dashboard/test_pool.py | 2 ++ .../frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qa/tasks/mgr/dashboard/test_pool.py b/qa/tasks/mgr/dashboard/test_pool.py index bae49fc8b36..1330ed7e9c1 100644 --- a/qa/tasks/mgr/dashboard/test_pool.py +++ b/qa/tasks/mgr/dashboard/test_pool.py @@ -32,6 +32,7 @@ class PoolTest(DashboardTestCase): self.assertIn('pool_name', pool) self.assertIn('type', pool) self.assertIn('application_metadata', pool) + self.assertIsInstance(pool['application_metadata'], list) self.assertIn('flags', pool) self.assertIn('flags_names', pool) self.assertNotIn('stats', pool) @@ -94,6 +95,7 @@ class PoolTest(DashboardTestCase): elif k == 'pg_num': self.assertEqual(pool[k], int(v), '{}: {} != {}'.format(k, pool[k], v)) elif k == 'application_metadata': + self.assertIsInstance(pool[k], list) self.assertEqual(pool[k], data['application_metadata'].split(',')) elif k == 'pool': diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts index c6add11f11f..5e936f0a9e1 100644 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts @@ -197,7 +197,7 @@ export class RbdFormComponent implements OnInit { const pools = []; const dataPools = []; for (const pool of resp) { - if (!_.isUndefined(pool.application_metadata.rbd)) { + if (_.indexOf(pool.application_metadata, 'rbd') !== -1) { if (pool.type === 'replicated') { pools.push(pool); dataPools.push(pool); -- 2.47.3