]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
Remove unused exceptions
authorKIYOHIRO ADACHI <adachi@mxs.nes.nec.co.jp>
Fri, 10 Jan 2014 09:22:36 +0000 (18:22 +0900)
committerKIYOHIRO ADACHI <adachi@mxs.nes.nec.co.jp>
Tue, 21 Jan 2014 00:21:14 +0000 (09:21 +0900)
The following exceptions are not used.
  class MigrationNotFound(NotFound):
  class BadDriverResponseStatus(VolumeDriverException):
  class InstanceNotFound(NotFound):
  class VolumeRetypeFailed(CinderException):
  class DuplicateSolidFireVolumeNames(SolidFireDriverException):

Change-Id: I891360f9c150eb8ea3f3968f12b9ad3da998981a

cinder/exception.py
cinder/tests/api/contrib/test_extended_snapshot_attributes.py

index 68d5649576981dfbf003fe3f0b97ccc728c19b0e..aa478cd8f46e87f5e740290c80dbf946f3f9105a 100644 (file)
@@ -352,10 +352,6 @@ class OverQuota(CinderException):
     message = _("Quota exceeded for resources: %(overs)s")
 
 
-class MigrationNotFound(NotFound):
-    message = _("Migration %(migration_id)s could not be found.")
-
-
 class FileNotFound(NotFound):
     message = _("File %(file_path)s could not be found.")
 
@@ -435,18 +431,10 @@ class MalformedResponse(VolumeDriverException):
     message = _("Malformed response to command %(cmd)s: %(reason)s")
 
 
-class BadDriverResponseStatus(VolumeDriverException):
-    message = _("Bad driver response status: %(status)s")
-
-
 class FailedCmdWithDump(VolumeDriverException):
     message = _("Operation failed with status=%(status)s. Full dump: %(data)s")
 
 
-class InstanceNotFound(NotFound):
-    message = _("Instance %(instance_id)s could not be found.")
-
-
 class GlanceMetadataExists(Invalid):
     message = _("Glance metadata cannot be updated, key %(key)s"
                 " exists for volume id %(volume_id)s")
@@ -561,10 +549,6 @@ class KeyManagerError(CinderException):
     msg_fmt = _("key manager error: %(reason)s")
 
 
-class VolumeRetypeFailed(CinderException):
-    message = _("Volume retype failed: %(reason)s")
-
-
 # Driver specific exceptions
 # Coraid
 class CoraidException(VolumeDriverException):
@@ -642,10 +626,6 @@ class SolidFireAccountNotFound(SolidFireDriverException):
                 "Solidfire device")
 
 
-class DuplicateSolidFireVolumeNames(SolidFireDriverException):
-    message = _("Detected more than one volume with name %(vol_name)s")
-
-
 # HP 3Par
 class Invalid3PARDomain(VolumeDriverException):
     message = _("Invalid 3PAR Domain: %(err)s")
index c1d0b1506e51d478da791534b34f44a13cbe6b83..e90c291634343c4ac0a6583ec8da58c1b6da73f4 100644 (file)
@@ -18,7 +18,6 @@ from lxml import etree
 import webob
 
 from cinder.api.contrib import extended_snapshot_attributes
-from cinder import exception
 from cinder.openstack.common import jsonutils
 from cinder import test
 from cinder.tests.api import fakes
@@ -97,17 +96,6 @@ class ExtendedSnapshotAttributesTest(test.TestCase):
                                           project_id='fake',
                                           progress='0%')
 
-    def test_no_instance_passthrough_404(self):
-
-        def fake_snapshot_get(*args, **kwargs):
-            raise exception.InstanceNotFound(instance_id='fake')
-
-        self.stubs.Set(volume.api.API, 'get_snapshot', fake_snapshot_get)
-        url = '/v2/fake/snapshots/70f6db34-de8d-4fbd-aafb-4065bdfa6115'
-        res = self._make_request(url)
-
-        self.assertEqual(res.status_int, 404)
-
 
 class ExtendedSnapshotAttributesXmlTest(ExtendedSnapshotAttributesTest):
     content_type = 'application/xml'