From: John Mulligan Date: Sat, 20 Jan 2024 15:45:46 +0000 (-0500) Subject: pybind/mgr/cephadm: fix incorrect return type X-Git-Tag: v19.3.0~130^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=e71e7c14453bc69f43a7c225ffe691c4ae5e8794;p=ceph.git pybind/mgr/cephadm: fix incorrect return type Found using mypy 0.990. Newer versions of mypy see that the callback function passed to `addFilter` are expected to return a bool. Update `cherrypy_filter` to do have the correct type. I did not try to fix the issue that this same function seems copy-pasted into three different files. >:-} Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/cephadm/agent.py b/src/pybind/mgr/cephadm/agent.py index 93a08cb3439..ba9c21de07b 100644 --- a/src/pybind/mgr/cephadm/agent.py +++ b/src/pybind/mgr/cephadm/agent.py @@ -29,7 +29,7 @@ if TYPE_CHECKING: from cephadm.module import CephadmOrchestrator -def cherrypy_filter(record: logging.LogRecord) -> int: +def cherrypy_filter(record: logging.LogRecord) -> bool: blocked = [ 'TLSV1_ALERT_DECRYPT_ERROR' ] diff --git a/src/pybind/mgr/cephadm/http_server.py b/src/pybind/mgr/cephadm/http_server.py index ef29d3b4e75..56a87bdcf64 100644 --- a/src/pybind/mgr/cephadm/http_server.py +++ b/src/pybind/mgr/cephadm/http_server.py @@ -12,7 +12,7 @@ if TYPE_CHECKING: from cephadm.module import CephadmOrchestrator -def cherrypy_filter(record: logging.LogRecord) -> int: +def cherrypy_filter(record: logging.LogRecord) -> bool: blocked = [ 'TLSV1_ALERT_DECRYPT_ERROR' ] diff --git a/src/pybind/mgr/cephadm/service_discovery.py b/src/pybind/mgr/cephadm/service_discovery.py index ddc0574e2b1..b681cc8e7ff 100644 --- a/src/pybind/mgr/cephadm/service_discovery.py +++ b/src/pybind/mgr/cephadm/service_discovery.py @@ -24,7 +24,7 @@ if TYPE_CHECKING: from cephadm.module import CephadmOrchestrator -def cherrypy_filter(record: logging.LogRecord) -> int: +def cherrypy_filter(record: logging.LogRecord) -> bool: blocked = [ 'TLSV1_ALERT_DECRYPT_ERROR' ]