Fixed raise text value instead of Exception

I used ValueError for both exception.
Also removed unnecessary flake8 ignore option.

Closes-Bug: #1917351
Change-Id: I5ee58aa0a34d7c266b3811f9c6b9b3076bfdc048
This commit is contained in:
Robert Gildein
2021-03-12 12:19:34 +01:00
parent d0d002cacf
commit 1a7e8df4ef
2 changed files with 4 additions and 4 deletions

View File

@@ -79,9 +79,9 @@ class Crushmap(object):
stdin=crush.stdout) stdin=crush.stdout)
.decode('UTF-8')) .decode('UTF-8'))
except CalledProcessError as e: except CalledProcessError as e:
log("Error occured while loading and decompiling CRUSH map:" log("Error occurred while loading and decompiling CRUSH map:"
"{}".format(e), ERROR) "{}".format(e), ERROR)
raise "Failed to read CRUSH map" raise
def ensure_bucket_is_present(self, bucket_name): def ensure_bucket_is_present(self, bucket_name):
if bucket_name not in [bucket.name for bucket in self.buckets()]: if bucket_name not in [bucket.name for bucket in self.buckets()]:
@@ -111,7 +111,7 @@ class Crushmap(object):
return ceph_output return ceph_output
except CalledProcessError as e: except CalledProcessError as e:
log("save error: {}".format(e)) log("save error: {}".format(e))
raise "Failed to save CRUSH map." raise
def build_crushmap(self): def build_crushmap(self):
"""Modifies the current CRUSH map to include the new buckets""" """Modifies the current CRUSH map to include the new buckets"""

View File

@@ -42,4 +42,4 @@ basepython = python3
commands = {posargs} commands = {posargs}
[flake8] [flake8]
ignore = E402,E226,W504 ignore = E402,W503,W504