]> 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)
committerSebastian Wagner <sebastian.wagner@suse.com>
Tue, 23 Feb 2021 09:58:23 +0000 (10:58 +0100)
Signed-off-by: Michael Fritch <mfritch@suse.com>
(cherry picked from commit 9b0a3e623984605bbcbcd82d38a7ccb6106b1d2b)

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 28c862dc4f201cfd7ad6a0398d78178d04bbc74a..6b745076276cf6e82197b14a2a7fba2333ef7360 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 b9da10b32d717278884225afb99313f77818523d..f50f59399da0a2c16442bfc48c1968896d1d73c3 100644 (file)
@@ -12,7 +12,6 @@ requires = cython
 max-line-length = 100
 ignore =
     E501,
-    E722,
     E731,
     E741,
     F401,