mirror of
https://github.com/ceph/ceph
synced 2024-12-28 06:23:08 +00:00
Merge pull request #21024 from s0nea/wip-dashboard-return-features-list
mgr/dashboard: Convert the RBD feature names to a list of strings Reviewed-by: Ricardo Dias <rdias@suse.com> Reviewed-by: Ricardo Marques <rimarques@suse.com> Reviewed-by: Stephan Müller <smueller@suse.com>
This commit is contained in:
commit
d5e54fda5c
@ -40,7 +40,7 @@ class RbdTest(DashboardTestCase):
|
||||
self.assertEqual(img1['num_objs'], 256)
|
||||
self.assertEqual(img1['obj_size'], 4194304)
|
||||
self.assertEqual(img1['features_name'],
|
||||
'deep-flatten, exclusive-lock, fast-diff, layering, object-map')
|
||||
['deep-flatten', 'exclusive-lock', 'fast-diff', 'layering', 'object-map'])
|
||||
|
||||
img2 = data['value'][1]
|
||||
self.assertEqual(img2['name'], 'img2')
|
||||
@ -48,7 +48,7 @@ class RbdTest(DashboardTestCase):
|
||||
self.assertEqual(img2['num_objs'], 512)
|
||||
self.assertEqual(img2['obj_size'], 4194304)
|
||||
self.assertEqual(img2['features_name'],
|
||||
'deep-flatten, exclusive-lock, fast-diff, layering, object-map')
|
||||
['deep-flatten', 'exclusive-lock', 'fast-diff', 'layering', 'object-map'])
|
||||
|
||||
@authenticate
|
||||
def test_create(self):
|
||||
@ -70,7 +70,8 @@ class RbdTest(DashboardTestCase):
|
||||
self.assertEqual(rbd['num_objs'], 1)
|
||||
self.assertEqual(rbd['obj_size'], 4194304)
|
||||
self.assertEqual(rbd['features_name'],
|
||||
'deep-flatten, exclusive-lock, fast-diff, layering, object-map')
|
||||
['deep-flatten', 'exclusive-lock', 'fast-diff', 'layering',
|
||||
'object-map'])
|
||||
break
|
||||
|
||||
@authenticate
|
||||
@ -100,8 +101,9 @@ class RbdTest(DashboardTestCase):
|
||||
self.assertEqual(rbd['size'], 10240)
|
||||
self.assertEqual(rbd['num_objs'], 1)
|
||||
self.assertEqual(rbd['obj_size'], 4194304)
|
||||
self.assertEqual(rbd['features_name'], 'data-pool, deep-flatten, exclusive-lock, '
|
||||
'fast-diff, layering, object-map')
|
||||
self.assertEqual(rbd['features_name'],
|
||||
['data-pool', 'deep-flatten', 'exclusive-lock', 'fast-diff',
|
||||
'layering', 'object-map'])
|
||||
break
|
||||
|
||||
self._ceph_cmd(['osd', 'pool', 'delete', 'data_pool', 'data_pool',
|
||||
|
@ -34,11 +34,11 @@ class Rbd(RESTController):
|
||||
Formats the bitmask:
|
||||
|
||||
>>> Rbd._format_bitmask(45)
|
||||
'deep-flatten, exclusive-lock, layering, object-map'
|
||||
['deep-flatten', 'exclusive-lock', 'layering', 'object-map']
|
||||
"""
|
||||
names = [val for key, val in Rbd.RBD_FEATURES_NAME_MAPPING.items()
|
||||
if key & features == key]
|
||||
return ', '.join(sorted(names))
|
||||
return sorted(names)
|
||||
|
||||
@staticmethod
|
||||
def _format_features(features):
|
||||
|
Loading…
Reference in New Issue
Block a user