Merge "Handle BadRequest in VolumeDetachTask"
This commit is contained in:
commit
d61a8980bf
@ -230,8 +230,9 @@ class VolumeDetachTask(object):
|
||||
|
||||
try:
|
||||
server_api.delete_server_volume(self.server_id, self.volume_id)
|
||||
except clients.novaclient.exceptions.NotFound:
|
||||
logger.warning('%s - not found' % str(self))
|
||||
except (clients.novaclient.exceptions.BadRequest,
|
||||
clients.novaclient.exceptions.NotFound) as e:
|
||||
logger.warning('%s - %s' % (str(self), str(e)))
|
||||
|
||||
yield
|
||||
|
||||
@ -244,7 +245,8 @@ class VolumeDetachTask(object):
|
||||
try:
|
||||
server_api.delete_server_volume(self.server_id,
|
||||
self.volume_id)
|
||||
except clients.novaclient.exceptions.NotFound:
|
||||
except (clients.novaclient.exceptions.BadRequest,
|
||||
clients.novaclient.exceptions.NotFound):
|
||||
pass
|
||||
vol.get()
|
||||
|
||||
|
@ -302,6 +302,10 @@ class VolumeTest(HeatTestCase):
|
||||
|
||||
self.cinder_fc.volumes.get('vol-123').AndReturn(fva)
|
||||
|
||||
self.fc.volumes.delete_server_volume(
|
||||
'WikiDatabase', 'vol-123').AndRaise(
|
||||
clients.novaclient.exceptions.BadRequest('Already detached'))
|
||||
|
||||
self.fc.volumes.delete_server_volume(
|
||||
'WikiDatabase', 'vol-123').AndRaise(
|
||||
clients.novaclient.exceptions.NotFound('Not found'))
|
||||
|
Loading…
x
Reference in New Issue
Block a user