mirror of
https://github.com/ceph/ceph
synced 2025-01-04 10:12:30 +00:00
pybind/mgr/fsstatus: cope with missing 'ceph_version'
The fsstats module assumes ceph_version always exists in daemon metadata, but it actually might not if run against older daemons (see previous commit). As the version here is actually being presented to the user, I've set it to "unknown" in the missing case, rather than an empty string. Signed-off-by: Tim Serong <tserong@suse.com>
This commit is contained in:
parent
37e7029ac4
commit
7882b86a98
@ -156,7 +156,7 @@ class Module(MgrModule):
|
|||||||
) + "/s"
|
) + "/s"
|
||||||
|
|
||||||
metadata = self.get_metadata('mds', info['name'])
|
metadata = self.get_metadata('mds', info['name'])
|
||||||
mds_versions[metadata['ceph_version']].append(info['name'])
|
mds_versions[metadata.get('ceph_version', "unknown")].append(info['name'])
|
||||||
rank_table.add_row([
|
rank_table.add_row([
|
||||||
self.bold(rank.__str__()), c_state, info['name'],
|
self.bold(rank.__str__()), c_state, info['name'],
|
||||||
activity,
|
activity,
|
||||||
@ -215,7 +215,7 @@ class Module(MgrModule):
|
|||||||
standby_table = PrettyTable(["Standby MDS"])
|
standby_table = PrettyTable(["Standby MDS"])
|
||||||
for standby in fsmap['standbys']:
|
for standby in fsmap['standbys']:
|
||||||
metadata = self.get_metadata('mds', standby['name'])
|
metadata = self.get_metadata('mds', standby['name'])
|
||||||
mds_versions[metadata['ceph_version']].append(standby['name'])
|
mds_versions[metadata.get('ceph_version', "unknown")].append(standby['name'])
|
||||||
|
|
||||||
standby_table.add_row([standby['name']])
|
standby_table.add_row([standby['name']])
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user