From: Volker Theile Date: Tue, 17 Sep 2019 10:39:22 +0000 (+0200) Subject: mgr/dashboard: Prevent KeyError when requesting always_on_modules X-Git-Tag: v15.1.0~1444^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1ee85da0b28978f7fd52aa2d24b942c38ca274d7;p=ceph-ci.git 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 --- diff --git a/src/pybind/mgr/dashboard/controllers/mgr_modules.py b/src/pybind/mgr/dashboard/controllers/mgr_modules.py index 6e3cb5a3ee1..6b861349710 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: