]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Merge "Change generic NotFound to specific exception"
authorJenkins <jenkins@review.openstack.org>
Tue, 30 Jun 2015 23:31:03 +0000 (23:31 +0000)
committerGerrit Code Review <review@openstack.org>
Tue, 30 Jun 2015 23:31:03 +0000 (23:31 +0000)
1  2 
cinder/api/v2/snapshots.py
cinder/tests/unit/api/v2/stubs.py
cinder/tests/unit/api/v2/test_snapshots.py

index 45c7ac471ff975623aabbf12fef510947fd6e7c4,e1140ca374fcd29d55b63e0f7dc25fe9ef76d1a4..b91332c34853eec04dc9bc121a0e2a92f4ab3d11
@@@ -262,12 -258,9 +259,11 @@@ class SnapshotsController(wsgi.Controll
  
          try:
              snapshot = self.volume_api.get_snapshot(context, id)
 +            volume_utils.notify_about_snapshot_usage(context, snapshot,
 +                                                     'update.start')
              self.volume_api.update_snapshot(context, snapshot, update_dict)
-         except exception.NotFound:
-             msg = _("Snapshot could not be found")
-             raise exc.HTTPNotFound(explanation=msg)
+         except exception.SnapshotNotFound as error:
+             raise exc.HTTPNotFound(explanation=error.msg)
  
          snapshot.update(update_dict)
          req.cache_db_snapshot(snapshot)
Simple merge