From b1b65eb7592d76269d685613c50b9ed5e5a4fafe Mon Sep 17 00:00:00 2001 From: John Mulligan Date: Tue, 7 May 2024 13:50:28 -0400 Subject: [PATCH] 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 --- src/pybind/mgr/mgr_util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/pybind/mgr/mgr_util.py b/src/pybind/mgr/mgr_util.py index 7c0b2b08281..3497fcdb655 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) -- 2.39.5