]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Do not use bare except, specify exception instead (E722)
authorMichael Fritch <mfritch@suse.com>
Thu, 28 Jan 2021 19:13:39 +0000 (12:13 -0700)
committerMichael Fritch <mfritch@suse.com>
Fri, 5 Feb 2021 18:20:55 +0000 (11:20 -0700)
Signed-off-by: Michael Fritch <mfritch@suse.com>
src/pybind/mgr/cephadm/upgrade.py
src/pybind/mgr/orchestrator/module.py
src/pybind/mgr/tox.ini

index 9518a6ea90e0eb49d09e01c59d0b4141a255cd77..00941f6a66780a4b11c5d7ff3d152aa00782c7cf 100644 (file)
@@ -103,7 +103,7 @@ class CephadmUpgrade:
             (major, minor, patch) = version.split('.')
             assert int(minor) >= 0
             # patch might be a number or {number}-g{sha1}
-        except:
+        except ValueError:
             return 'version must be in the form X.Y.Z (e.g., 15.2.3)'
         if int(major) < 15 or (int(major) == 15 and int(minor) < 2):
             return 'cephadm only supports octopus (15.2.0) or later'
index 54122d4029a814ad3cf4c72a47b2f132c358c7ab..bb62e57da09f5ec532ac0af2f193c49577eb53cb 100644 (file)
@@ -284,7 +284,7 @@ class OrchestratorCli(OrchestratorClientMixin, MgrModule,
                 self._refresh_health()
             return HandleCommandResult(stdout=str(completion.result))
 
-        except:
+        except Exception:
             # There are several reasons the try: block might fail:
             # 1. the device no longer exist
             # 2. the device is no longer known to Ceph
index 109bb26964c27c9a7d49a6d29bf56485837797e0..a56035cc84966137dd7231aff1c5e97ae20ecca5 100644 (file)
@@ -12,7 +12,6 @@ requires = cython
 max-line-length = 100
 ignore =
     E501,
-    E722,
     E731,
     E741,
     F401,