]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: disable flake8 on a few non-obvious issues
authorJohn Mulligan <jmulligan@redhat.com>
Tue, 7 May 2024 17:50:28 +0000 (13:50 -0400)
committerJohn Mulligan <jmulligan@redhat.com>
Thu, 13 Jun 2024 14:14:29 +0000 (10:14 -0400)
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 <jmulligan@redhat.com>
src/pybind/mgr/mgr_util.py

index 7c0b2b082813264cd71a5bcaf71b2c82965e9372..3497fcdb6559897997d8908fb2b2e316cf7c2055 100644 (file)
@@ -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)