From: John Mulligan Date: Tue, 7 May 2024 17:50:28 +0000 (-0400) Subject: pybind/mgr: disable flake8 on a few non-obvious issues X-Git-Tag: v20.0.0~1618^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b1b65eb7592d76269d685613c50b9ed5e5a4fafe;p=ceph.git pybind/mgr: disable flake8 on a few non-obvious issues Use the `noqa` comment on a handful of lines that flake8 detects as issues. I don't want to invest a ton of time looking into if the imports cause needed side-effects. I also don't want to debug if the bare except is trying to catch exceptions that don't inherit from Exception. So, make the file flake8 clean by just suppressing these remaining things. Signed-off-by: John Mulligan --- diff --git a/src/pybind/mgr/mgr_util.py b/src/pybind/mgr/mgr_util.py index 7c0b2b082813..3497fcdb6559 100644 --- a/src/pybind/mgr/mgr_util.py +++ b/src/pybind/mgr/mgr_util.py @@ -1,7 +1,7 @@ import os if 'UNITTEST' in os.environ: - import tests + import tests # noqa import bcrypt import cephfs @@ -147,7 +147,7 @@ class CephfsConnectionPool(object): fs_id = None try: fs_id = self.get_fs_id() - except: + except: # noqa # the filesystem does not exist now -- connection is not valid. pass logger.debug("self.fs_id={0}, fs_id={1}".format(self.fs_id, fs_id)) @@ -605,7 +605,7 @@ def verify_cacrt(cert_fname): def get_cert_issuer_info(crt: str) -> Tuple[Optional[str], Optional[str]]: """Basic validation of a ca cert""" - from OpenSSL import crypto, SSL + from OpenSSL import crypto, SSL # noqa try: crt_buffer = crt.encode("ascii") if isinstance(crt, str) else crt (org_name, cn) = (None, None)