From: John Mulligan Date: Tue, 28 Mar 2023 21:07:20 +0000 (-0400) Subject: mgr/dashboard: ignore type checking for exception handling module X-Git-Tag: v17.2.8~507^2~7 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=49f22553475d9a81780b82f923b0886e08fa4fac;p=ceph.git mgr/dashboard: ignore type checking for exception handling module 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 (cherry picked from commit e767b8643aa6565a6149a600df3d87a7b31f737a) --- diff --git a/src/pybind/mgr/dashboard/services/exception.py b/src/pybind/mgr/dashboard/services/exception.py index ed4fbe8003d9d..c39209569dbd7 100644 --- a/src/pybind/mgr/dashboard/services/exception.py +++ b/src/pybind/mgr/dashboard/services/exception.py @@ -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