Throw InvalidSnapshot for failed snap delete
When delete is called for a snapshot not in the "available" or "error" state, throw an InvalidSnapshot exception rather than InvalidVolume. Change-Id: I47f55b3357d75b5c0c9a704aaf693f4764fd112c
This commit is contained in:
@@ -586,7 +586,7 @@ class API(base.Base):
|
||||
def delete_snapshot(self, context, snapshot, force=False):
|
||||
if not force and snapshot['status'] not in ["available", "error"]:
|
||||
msg = _("Volume Snapshot status must be available or error")
|
||||
raise exception.InvalidVolume(reason=msg)
|
||||
raise exception.InvalidSnapshot(reason=msg)
|
||||
self.db.snapshot_update(context, snapshot['id'],
|
||||
{'status': 'deleting'})
|
||||
volume = self.db.volume_get(context, snapshot['volume_id'])
|
||||
|
||||
Reference in New Issue
Block a user