Merge "Remove redundant try except around volume create"
This commit is contained in:
commit
aac2a83df6
|
@ -962,17 +962,10 @@ class Store(glance_store.driver.Store):
|
||||||
LOG.info(_LI("Since image size is zero, we will be doing "
|
LOG.info(_LI("Since image size is zero, we will be doing "
|
||||||
"resize-before-write for each GB which "
|
"resize-before-write for each GB which "
|
||||||
"will be considerably slower than normal."))
|
"will be considerably slower than normal."))
|
||||||
try:
|
|
||||||
volume = self.volume_api.create(client, size_gb, name=name,
|
volume = self.volume_api.create(client, size_gb, name=name,
|
||||||
metadata=metadata,
|
metadata=metadata,
|
||||||
volume_type=volume_type)
|
volume_type=volume_type)
|
||||||
except cinder_exception.NotFound:
|
|
||||||
LOG.error(_LE("Invalid volume type %s configured. Please check "
|
|
||||||
"the `cinder_volume_type` configuration parameter."
|
|
||||||
% volume_type))
|
|
||||||
msg = (_("Failed to create image-volume due to invalid "
|
|
||||||
"`cinder_volume_type` configured."))
|
|
||||||
raise exceptions.BackendException(msg)
|
|
||||||
|
|
||||||
volume = self._wait_volume_status(volume, 'creating', 'available')
|
volume = self._wait_volume_status(volume, 'creating', 'available')
|
||||||
size_gb = volume.size
|
size_gb = volume.size
|
||||||
|
|
Loading…
Reference in New Issue