When delete is called for a snapshot not in the "available" or
"error" state, throw an InvalidSnapshot exception rather than
InvalidVolume.
Change-Id: I47f55b3357d75b5c0c9a704aaf693f4764fd112c
volume_api = cinder.volume.api.API()
snapshot['status'] = 'badstatus'
- self.assertRaises(exception.InvalidVolume,
+ self.assertRaises(exception.InvalidSnapshot,
volume_api.delete_snapshot,
self.context,
snapshot)
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'])