]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: fix backend error when updating RBD interlocked features 28147/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, 16 May 2019 09:43:29 +0000 (17:43 +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>
qa/tasks/mgr/dashboard/test_rbd.py
src/pybind/mgr/dashboard/controllers/rbd.py

index 25725f2320e51e2343eb789375dd492ab5262453..617e97c76b661f5d5127fc89c06243c8aacc365b 100644 (file)
@@ -479,6 +479,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',
@@ -486,6 +487,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)