From: Volker Theile Date: Mon, 23 Apr 2018 14:47:34 +0000 (+0200) Subject: mgr/dashboard: Fix bug in RBD form. X-Git-Tag: v13.1.0~134^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F21602%2Fhead;p=ceph.git mgr/dashboard: Fix bug in RBD form. Signed-off-by: Volker Theile --- diff --git a/qa/tasks/mgr/dashboard/test_pool.py b/qa/tasks/mgr/dashboard/test_pool.py index bae49fc8b360..1330ed7e9c17 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 c6add11f11f2..5e936f0a9e1e 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);