From e1df7d939ff9f3445b129c9ace5387bd639c8e7a Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 28 Mar 2023 17:06:51 -0400 Subject: [PATCH] mgr/dashboard: add an assertion for type narrowing This change makes this file pass mypy checking on mypy 0.981. Signed-off-by: John Mulligan --- src/pybind/mgr/dashboard/controllers/_rest_controller.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pybind/mgr/dashboard/controllers/_rest_controller.py b/src/pybind/mgr/dashboard/controllers/_rest_controller.py index 6b4afc27672c1..0224c366f3bca 100644 --- a/src/pybind/mgr/dashboard/controllers/_rest_controller.py +++ b/src/pybind/mgr/dashboard/controllers/_rest_controller.py @@ -70,6 +70,7 @@ class RESTController(BaseController, skip_registry=True): for k, v in cls._method_mapping.items(): func = getattr(cls, k, None) while hasattr(func, "__wrapped__"): + assert func func = func.__wrapped__ if v['resource'] and func: path_params = cls.get_path_param_names() -- 2.39.5