]> git-server-git.apps.pok.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)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 30 Mar 2023 20:52:53 +0000 (16:52 -0400)
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>
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