Fix variable name in api/v<n>/snapshot.py

Noticed in a recent bug fix that the when the show
method was copy/pasted at some point the variable name
vol was not updated.

Silly annoyance, but thought I'd go ahead and replace vol
with snapshot to make the variable name reflect what's
actually in use here.

Change-Id: I137ecc4987258450e93195cfed5e128063b92914
This commit is contained in:
John Griffith 2014-08-20 13:12:09 -06:00
parent 058fcf6da8
commit d68efcc0e0
2 changed files with 6 additions and 6 deletions

View File

@ -106,12 +106,12 @@ class SnapshotsController(wsgi.Controller):
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."""

View File

@ -106,13 +106,13 @@ class SnapshotsController(wsgi.Controller):
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."""