Merge "Catch exception in volume get"
This commit is contained in:
commit
75ccbeb8d0
@ -42,7 +42,10 @@ class CinderAPI(object):
|
|||||||
|
|
||||||
def search_volume(self, volume):
|
def search_volume(self, volume):
|
||||||
if uuidutils.is_uuid_like(volume):
|
if uuidutils.is_uuid_like(volume):
|
||||||
volume = self.cinder.volumes.get(volume)
|
try:
|
||||||
|
volume = self.cinder.volumes.get(volume)
|
||||||
|
except cinder_exception.NotFound:
|
||||||
|
raise exception.VolumeNotFound(volume=volume)
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
volume = self.cinder.volumes.find(name=volume)
|
volume = self.cinder.volumes.find(name=volume)
|
||||||
|
Loading…
Reference in New Issue
Block a user