context = req.environ['cinder.context']
try:
- vol = self.volume_api.get_snapshot(context, id)
- req.cache_resource(vol)
+ snapshot = self.volume_api.get_snapshot(context, id)
+ req.cache_resource(snapshot)
except exception.NotFound:
raise exc.HTTPNotFound()
- return {'snapshot': _translate_snapshot_detail_view(context, vol)}
+ return {'snapshot': _translate_snapshot_detail_view(context, snapshot)}
def delete(self, req, id):
"""Delete a snapshot."""
context = req.environ['cinder.context']
try:
- vol = self.volume_api.get_snapshot(context, id)
- req.cache_resource(vol)
+ snapshot = self.volume_api.get_snapshot(context, id)
+ req.cache_resource(snapshot)
except exception.NotFound:
msg = _("Snapshot could not be found")
raise exc.HTTPNotFound(explanation=msg)
- return {'snapshot': _translate_snapshot_detail_view(context, vol)}
+ return {'snapshot': _translate_snapshot_detail_view(context, snapshot)}
def delete(self, req, id):
"""Delete a snapshot."""