From d68efcc0e078315f0f75637f313e3dbde0b4c2b4 Mon Sep 17 00:00:00 2001 From: John Griffith Date: Wed, 20 Aug 2014 13:12:09 -0600 Subject: [PATCH] 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 --- cinder/api/v1/snapshots.py | 6 +++--- cinder/api/v2/snapshots.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) 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.""" -- 2.45.2