diff --git a/cinder/exception.py b/cinder/exception.py index 2b9d81c0364..654a7a7ee8d 100644 --- a/cinder/exception.py +++ b/cinder/exception.py @@ -1213,8 +1213,3 @@ class ServiceUserTokenNoAuth(CinderException): message = _("The [service_user] send_service_user_token option was " "requested, but no service auth could be loaded. Please check " "the [service_user] configuration section.") - - -class UnsupportedNVMETProtocol(Invalid): - message = _("An invalid 'target_protocol' " - "value was provided: %(protocol)s") diff --git a/cinder/tests/unit/targets/test_nvmeof_driver.py b/cinder/tests/unit/targets/test_nvmeof_driver.py index 31f80ef3051..102a41a6eed 100644 --- a/cinder/tests/unit/targets/test_nvmeof_driver.py +++ b/cinder/tests/unit/targets/test_nvmeof_driver.py @@ -133,7 +133,7 @@ class TestNVMeOFDriver(tf.TargetDriverFixture): def test_invalid_target_protocol(self): self.configuration.target_protocol = 'iser' - self.assertRaises(exception.UnsupportedNVMETProtocol, + self.assertRaises(nvmeof.UnsupportedNVMETProtocol, FakeNVMeOFDriver, root_helper=utils.get_root_helper(), configuration=self.configuration) diff --git a/cinder/volume/targets/nvmeof.py b/cinder/volume/targets/nvmeof.py index 8a97e9e3d31..c4d30062c4d 100644 --- a/cinder/volume/targets/nvmeof.py +++ b/cinder/volume/targets/nvmeof.py @@ -15,12 +15,18 @@ import abc from oslo_log import log as logging from cinder import exception +from cinder.i18n import _ from cinder.volume.targets import driver LOG = logging.getLogger(__name__) +class UnsupportedNVMETProtocol(exception.Invalid): + message = _("An invalid 'target_protocol' " + "value was provided: %(protocol)s") + + class NVMeOF(driver.Target): """Target object for block storage devices with RDMA transport.""" @@ -44,7 +50,7 @@ class NVMeOF(driver.Target): self.nvme_transport_type = self.target_protocol_map[ target_protocol] else: - raise exception.UnsupportedNVMETProtocol( + raise UnsupportedNVMETProtocol( protocol=target_protocol )