]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Fix variable name in api/v<n>/snapshot.py
authorJohn Griffith <john.griffith8@gmail.com>
Wed, 20 Aug 2014 19:12:09 +0000 (13:12 -0600)
committerJohn Griffith <john.griffith8@gmail.com>
Wed, 20 Aug 2014 19:12:09 +0000 (13:12 -0600)
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
cinder/api/v2/snapshots.py

index 7b944afc785de8adf9a5b2a749004f8c23e52981..922f67b81b4d5d4e7c1858eb385747f8d3010462 100644 (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."""
index efe2c780c74417e23f80598100bb2a56bf59677b..2c053ccb5c7e4424020d505aba17a378045ad6c3 100644 (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."""