]> git-server-git.apps.pok.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)
committerAfreen <afreen23.git@gmail.com>
Thu, 15 Feb 2024 08:29:36 +0000 (13:59 +0530)
This change makes this file pass mypy checking on mypy 0.981.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit e1df7d939ff9f3445b129c9ace5387bd639c8e7a)

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()