mirror of
https://github.com/ceph/ceph
synced 2025-02-23 02:57:21 +00:00
pybind/mgr/status: always map 'mds_version' to a list of dict
more consistent this way, as json format is supposed to be consumed by a parser not human being. Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
parent
5ac2901f54
commit
6f68dea55c
@ -244,9 +244,10 @@ class Module(MgrModule):
|
||||
|
||||
if len(mds_versions) == 1:
|
||||
if output_format in ('json', 'json-pretty'):
|
||||
json_output['mds_version'] = list(mds_versions)[0]
|
||||
json_output['mds_version'] = [dict(version=k, daemon=v)
|
||||
for k, v in mds_versions.items()]
|
||||
else:
|
||||
output += "MDS version: {0}".format(list(mds_versions)[0])
|
||||
output += "MDS version: {0}".format([*mds_versions][0])
|
||||
else:
|
||||
version_table = PrettyTable(["VERSION", "DAEMONS"],
|
||||
border=False)
|
||||
|
Loading…
Reference in New Issue
Block a user