From 1ee85da0b28978f7fd52aa2d24b942c38ca274d7 Mon Sep 17 00:00:00 2001 From: Volker Theile Date: Tue, 17 Sep 2019 12:39:22 +0200 Subject: [PATCH] mgr/dashboard: Prevent KeyError when requesting always_on_modules `ceph_release` is not necessarily a valid key for `mgr_map['always_on_modules']` This PR is inspired by https://github.com/ceph/ceph/pull/30421. Signed-off-by: Volker Theile --- src/pybind/mgr/dashboard/controllers/mgr_modules.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/controllers/mgr_modules.py b/src/pybind/mgr/dashboard/controllers/mgr_modules.py index 6e3cb5a3ee18..6b8613497103 100644 --- a/src/pybind/mgr/dashboard/controllers/mgr_modules.py +++ b/src/pybind/mgr/dashboard/controllers/mgr_modules.py @@ -21,7 +21,7 @@ class MgrModules(RESTController): """ result = [] mgr_map = mgr.get('mgr_map') - always_on_modules = mgr_map['always_on_modules'][mgr.release_name] + always_on_modules = mgr_map['always_on_modules'].get(mgr.release_name, []) for module_config in mgr_map['available_modules']: module_name = module_config['name'] if module_name not in self.ignore_modules: -- 2.47.3