mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
mgr/dashboard: add rbd primary info
Signed-off-by: Pere Diaz Bou <pdiazbou@redhat.com>
This commit is contained in:
parent
9e3d8521cf
commit
578ee21f59
@ -211,6 +211,7 @@ class RbdTest(DashboardTestCase):
|
||||
"name": "img1",
|
||||
"pool_name": "rbd",
|
||||
"features": 61,
|
||||
"primary": true,
|
||||
"features_name": ["deep-flatten", "exclusive-lock", "fast-diff", "layering",
|
||||
"object-map"]
|
||||
}
|
||||
@ -227,6 +228,7 @@ class RbdTest(DashboardTestCase):
|
||||
'image_format': JLeaf(int),
|
||||
'pool_name': JLeaf(str),
|
||||
'namespace': JLeaf(str, none=True),
|
||||
'primary': JLeaf(bool, none=True),
|
||||
'features': JLeaf(int),
|
||||
'features_name': JList(JLeaf(str)),
|
||||
'stripe_count': JLeaf(int, none=True),
|
||||
|
@ -250,6 +250,12 @@ class RbdService(object):
|
||||
|
||||
stat = img.stat()
|
||||
stat['name'] = image_name
|
||||
|
||||
mirror_info = img.mirror_image_get_info()
|
||||
stat['primary'] = None
|
||||
if mirror_info['state'] == rbd.RBD_MIRROR_IMAGE_ENABLED:
|
||||
stat['primary'] = mirror_info['primary']
|
||||
|
||||
if img.old_format():
|
||||
stat['unique_id'] = get_image_spec(pool_name, namespace, stat['block_name_prefix'])
|
||||
stat['id'] = stat['unique_id']
|
||||
|
Loading…
Reference in New Issue
Block a user