From: John Griffith Date: Wed, 20 Aug 2014 19:12:09 +0000 (-0600) Subject: Fix variable name in api/v/snapshot.py X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=d68efcc0e078315f0f75637f313e3dbde0b4c2b4;p=openstack-build%2Fcinder-build.git Fix variable name in api/v/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 --- diff --git a/cinder/api/v1/snapshots.py b/cinder/api/v1/snapshots.py index 7b944afc7..922f67b81 100644 --- a/cinder/api/v1/snapshots.py +++ b/cinder/api/v1/snapshots.py @@ -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.""" diff --git a/cinder/api/v2/snapshots.py b/cinder/api/v2/snapshots.py index efe2c780c..2c053ccb5 100644 --- a/cinder/api/v2/snapshots.py +++ b/cinder/api/v2/snapshots.py @@ -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."""