]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix backend error when updating RBD interlocked features 28218/head
authorKiefer Chang <kiefer.chang@suse.com>
Thu, 16 May 2019 07:53:35 +0000 (15:53 +0800)
committerKiefer Chang <kiefer.chang@suse.com>
Thu, 23 May 2019 02:53:00 +0000 (10:53 +0800)
Now object-map and fast-diff features are interlocked. Allow
enabling/disabling these two features together without raising an already
enabled/disabled error.

Fixes: http://tracker.ceph.com/issues/39933
Signed-off-by: Kiefer Chang <kiefer.chang@suse.com>
(cherry picked from commit d654e8c620537718cb85ccd4c327faedb001ad02)

qa/tasks/mgr/dashboard/test_rbd.py
src/pybind/mgr/dashboard/controllers/rbd.py

index f9b7dd022fa65fa90ebca932a13540a2859747d7..b1c64bbdde5ab01452158ac62a2f0c2fb5f42714 100644 (file)
@@ -478,6 +478,7 @@ class RbdTest(DashboardTestCase):
         self._validate_image(img, features_name=["layering"])
         self.edit_image('rbd', 'edit_img',
                         features=["fast-diff", "object-map", "exclusive-lock"])
+        self.assertStatus(200)
         img = self._get('/api/block/image/rbd/edit_img')
         self.assertStatus(200)
         self._validate_image(img, features_name=['exclusive-lock',
@@ -485,6 +486,7 @@ class RbdTest(DashboardTestCase):
                                                  'object-map'])
         self.edit_image('rbd', 'edit_img',
                         features=["journaling", "exclusive-lock"])
+        self.assertStatus(200)
         img = self._get('/api/block/image/rbd/edit_img')
         self.assertStatus(200)
         self._validate_image(img, features_name=['exclusive-lock',
index ea1f2043d7e0c18abf8cebe8723c6144bda81c17..24c068a7e5f672de72c926f73997585eb9bff128 100644 (file)
@@ -275,12 +275,16 @@ class Rbd(RESTController):
                 _sort_features(curr_features, enable=False)
                 for feature in curr_features:
                     if feature not in features and feature in self.ALLOW_DISABLE_FEATURES:
+                        if feature not in format_bitmask(image.features()):
+                            continue
                         f_bitmask = format_features([feature])
                         image.update_features(f_bitmask, False)
                 # check enabled features
                 _sort_features(features)
                 for feature in features:
                     if feature not in curr_features and feature in self.ALLOW_ENABLE_FEATURES:
+                        if feature in format_bitmask(image.features()):
+                            continue
                         f_bitmask = format_features([feature])
                         image.update_features(f_bitmask, True)