From 7882b86a98db56c21059e3b990972a6c95d70497 Mon Sep 17 00:00:00 2001 From: Tim Serong Date: Fri, 24 Mar 2017 16:50:05 +0100 Subject: [PATCH] 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 --- src/pybind/mgr/fsstatus/module.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pybind/mgr/fsstatus/module.py b/src/pybind/mgr/fsstatus/module.py index f137a5466b0..0db7ee750dd 100644 --- a/src/pybind/mgr/fsstatus/module.py +++ b/src/pybind/mgr/fsstatus/module.py @@ -156,7 +156,7 @@ class Module(MgrModule): ) + "/s" 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([ self.bold(rank.__str__()), c_state, info['name'], activity, @@ -215,7 +215,7 @@ class Module(MgrModule): standby_table = PrettyTable(["Standby MDS"]) for standby in fsmap['standbys']: 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']])