move storpool exception
This patch moves the storpool driver exception to the driver. Change-Id: Ifa04e1f8f9e09c83a6bed16daecda51863ea3bcb
This commit is contained in:
parent
56d56f09b1
commit
d67105c7f4
|
@ -1100,12 +1100,6 @@ class BadResetResourceStatus(CinderException):
|
|||
message = _("Bad reset resource status : %(reason)s")
|
||||
|
||||
|
||||
# StorPool driver
|
||||
class StorPoolConfigurationInvalid(CinderException):
|
||||
message = _("Invalid parameter %(param)s in the %(section)s section "
|
||||
"of the /etc/storpool.conf file: %(error)s")
|
||||
|
||||
|
||||
# DOTHILL drivers
|
||||
class DotHillInvalidBackend(VolumeDriverException):
|
||||
message = _("Backend doesn't exist (%(backend)s)")
|
||||
|
|
|
@ -192,7 +192,7 @@ class StorPoolTestCase(test.TestCase):
|
|||
@ddt.data(
|
||||
(5, TypeError),
|
||||
({'no-host': None}, KeyError),
|
||||
({'host': 'sbad'}, exception.StorPoolConfigurationInvalid),
|
||||
({'host': 'sbad'}, driver.StorPoolConfigurationInvalid),
|
||||
({'host': 's01'}, None),
|
||||
({'host': 'none'}, None),
|
||||
)
|
||||
|
@ -208,7 +208,7 @@ class StorPoolTestCase(test.TestCase):
|
|||
@ddt.data(
|
||||
(5, TypeError),
|
||||
({'no-host': None}, KeyError),
|
||||
({'host': 'sbad'}, exception.StorPoolConfigurationInvalid),
|
||||
({'host': 'sbad'}, driver.StorPoolConfigurationInvalid),
|
||||
)
|
||||
@ddt.unpack
|
||||
def test_initialize_connection_bad(self, conn, exc):
|
||||
|
|
|
@ -57,6 +57,11 @@ CONF = cfg.CONF
|
|||
CONF.register_opts(storpool_opts)
|
||||
|
||||
|
||||
class StorPoolConfigurationInvalid(exception.CinderException):
|
||||
message = _("Invalid parameter %(param)s in the %(section)s section "
|
||||
"of the /etc/storpool.conf file: %(error)s")
|
||||
|
||||
|
||||
@interface.volumedriver
|
||||
class StorPoolDriver(driver.VolumeDriver):
|
||||
"""The StorPool block device driver.
|
||||
|
@ -152,7 +157,7 @@ class StorPoolDriver(driver.VolumeDriver):
|
|||
except KeyError:
|
||||
return 65
|
||||
except Exception as e:
|
||||
raise exception.StorPoolConfigurationInvalid(
|
||||
raise StorPoolConfigurationInvalid(
|
||||
section=hostname, param='SP_OURID', error=e)
|
||||
|
||||
def validate_connector(self, connector):
|
||||
|
|
Loading…
Reference in New Issue