]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix bug in RBD form. 21602/head
authorVolker Theile <vtheile@suse.com>
Mon, 23 Apr 2018 14:47:34 +0000 (16:47 +0200)
committerVolker Theile <vtheile@suse.com>
Mon, 23 Apr 2018 15:13:31 +0000 (17:13 +0200)
Signed-off-by: Volker Theile <vtheile@suse.com>
qa/tasks/mgr/dashboard/test_pool.py
src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-form/rbd-form.component.ts

index bae49fc8b360d827e42184802e632f82e40fea80..1330ed7e9c178bcec2830fb9cac0283018d62c9b 100644 (file)
@@ -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':
index c6add11f11f27cf19fdb10748a80939ed90d1121..5e936f0a9e1efcec3b2853107759eaf0b3472511 100644 (file)
@@ -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);