When creating snapshot, if the volume does not exist
there will be lead to a log error. This patch will
fix this.
Closes-Bug:#
1545912
Change-Id:Ic99531dad4fab5e22e295e19bbfa94c7892e3ddc
def create_snapshot(self, snapshot):
volume = snapshot.get('volume')
if not volume:
- msg = (_("Can't find volume id from db, volume: %(id)s") %
- {"id": volume['id']})
+ msg = (_("Can't get volume id from snapshot, snapshot: %(id)s")
+ % {"id": snapshot['id']})
LOG.error(msg)
raise exception.VolumeBackendAPIException(data=msg)