]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: Fix pool renaming functionality 31617/head
authorStephan Müller <smueller@suse.com>
Wed, 13 Nov 2019 12:16:55 +0000 (13:16 +0100)
committerStephan Müller <smueller@suse.com>
Wed, 13 Nov 2019 16:25:30 +0000 (17:25 +0100)
The problem was that, if a pool was renamed the routine to update tried
to work on the old pool name and didn't used the info that the pool got
renamed, therefore an error occurred in the UI saying that the pool
could not be found.

Fixes: https://tracker.ceph.com/issues/42776
Signed-off-by: Stephan Müller <smueller@suse.com>
qa/tasks/mgr/dashboard/test_pool.py
src/pybind/mgr/dashboard/controllers/pool.py

index af610673ba18eed37afd0ae4cd43d40c8a09295b..390572bea6ddc9d80f470475a3fb71fbd9b2882a 100644 (file)
@@ -298,6 +298,16 @@ class PoolTest(DashboardTestCase):
                 self._validate_pool_properties(pool['pool_quotas_to_check'],
                                                self._get_pool(pool_name))
 
+    def test_pool_update_name(self):
+        name = 'pool_update'
+        updated_name = 'pool_updated_name'
+        with self.__yield_pool(name, None, updated_name):
+            props = {'pool': updated_name}
+            self._task_put('/api/pool/{}'.format(name), props)
+            time.sleep(5)
+            self.assertStatus(200)
+            self._validate_pool_properties(props, self._get_pool(updated_name))
+
     def test_pool_update_metadata(self):
         pool_name = 'pool_update_metadata'
         with self.__yield_pool(pool_name):
index 3139e1ab82fcd600da4c4310bcc90b30a454a08b..a7a422caccd6c00a0a87f29b0102d4e41a9b05bc 100644 (file)
@@ -83,6 +83,8 @@ class Pool(RESTController):
     @pool_task('edit', ['{pool_name}'])
     def set(self, pool_name, flags=None, application_metadata=None, configuration=None, **kwargs):
         self._set_pool_values(pool_name, application_metadata, flags, True, kwargs)
+        if kwargs.get('pool'):
+            pool_name = kwargs['pool']
         RbdConfiguration(pool_name).set_configuration(configuration)
         self._wait_for_pgs(pool_name)