]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: add an assertion for type narrowing
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 28 Mar 2023 21:06:51 +0000 (17:06 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 30 Mar 2023 20:52:53 +0000 (16:52 -0400)
This change makes this file pass mypy checking on mypy 0.981.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
src/pybind/mgr/dashboard/controllers/_rest_controller.py

index 6b4afc27672c1b52173fb01ff5c3de02909dd28c..0224c366f3bcae58fa133dc6899e0a5541f84a67 100644 (file)
@@ -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()