]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: ignore type checking for exception handling module
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 28 Mar 2023 21:07:20 +0000 (17:07 -0400)
committerAfreen <afreen23.git@gmail.com>
Thu, 15 Feb 2024 08:29:14 +0000 (13:59 +0530)
Add a `# type: ignore` comment to the exception handling dashboard
module just like the instance to lines below. This module does not
already import typing, so I'm not going to add it.
This change is needed in order to run mypy 0.981.

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

src/pybind/mgr/dashboard/services/exception.py

index ed4fbe8003d9d344af7b950509bfecee64a038ba..c39209569dbd7c9d91cac57dc5936c1bce0195f0 100644 (file)
@@ -34,7 +34,7 @@ def serialize_dashboard_exception(e, include_http_status=False, task=None):
     component = getattr(e, 'component', None)
     out['component'] = component if component else None
     if include_http_status:
-        out['status'] = getattr(e, 'status', 500)
+        out['status'] = getattr(e, 'status', 500)  # type: ignore
     if task:
         out['task'] = dict(name=task.name, metadata=task.metadata)  # type: ignore
     return out