Fix raise on Snapshot initialization
We were calling "raise" directly when initialization of a Snapshot failed due to the backend provided, but we were not within an "Except" caluse, so it was incorrect. This patch ensure we raise an appropriate ValueError exception.
This commit is contained in:
@@ -2,6 +2,13 @@
|
||||
History
|
||||
=======
|
||||
|
||||
0.3.9 (2019-02-18)
|
||||
------------------
|
||||
|
||||
- Bug fixes:
|
||||
|
||||
- Incorrect raise on Snapshot initialization backend errors.
|
||||
|
||||
0.3.8 (2019-02-15)
|
||||
------------------
|
||||
|
||||
|
||||
@@ -860,10 +860,10 @@ class Snapshot(NamedObject, LazyVolumeAttr):
|
||||
backend = param_backend and param_backend.id
|
||||
|
||||
if not (backend or param_backend):
|
||||
raise
|
||||
raise ValueError('Backend not provided')
|
||||
|
||||
if backend and param_backend and param_backend.id != backend:
|
||||
raise
|
||||
raise ValueError("Multiple backends provided and they don't match")
|
||||
|
||||
super(Snapshot, self).__init__(backend=param_backend or backend,
|
||||
**kwargs)
|
||||
|
||||
Reference in New Issue
Block a user