move Dell EMC SC driver exceptions
This patch moves the Dell EMC SC exceptions to the driver. Change-Id: I83ab1925dd7eb39cf64b9853cd65e2b7cb06e833
This commit is contained in:
parent
cf2a85629e
commit
30da697a59
@ -948,16 +948,6 @@ class VolumeDeviceNotFound(CinderException):
|
|||||||
message = _('Volume device not found at %(device)s.')
|
message = _('Volume device not found at %(device)s.')
|
||||||
|
|
||||||
|
|
||||||
# Driver specific exceptions
|
|
||||||
# Dell
|
|
||||||
class DellDriverRetryableException(VolumeBackendAPIException):
|
|
||||||
message = _("Retryable Dell Exception encountered")
|
|
||||||
|
|
||||||
|
|
||||||
class DellDriverUnknownSpec(VolumeDriverException):
|
|
||||||
message = _("Dell driver failure: %(reason)s")
|
|
||||||
|
|
||||||
|
|
||||||
# RemoteFS drivers
|
# RemoteFS drivers
|
||||||
class RemoteFSException(VolumeDriverException):
|
class RemoteFSException(VolumeDriverException):
|
||||||
message = _("Unknown RemoteFS exception")
|
message = _("Unknown RemoteFS exception")
|
||||||
|
@ -8954,7 +8954,8 @@ class DellHttpClientTestCase(test.TestCase):
|
|||||||
'get')
|
'get')
|
||||||
def test_wait_for_async_complete_get_raises(self,
|
def test_wait_for_async_complete_get_raises(self,
|
||||||
mock_get):
|
mock_get):
|
||||||
mock_get.side_effect = (exception.DellDriverRetryableException())
|
mock_get.side_effect = (
|
||||||
|
storagecenter_api.DellDriverRetryableException())
|
||||||
self.assertRaises(exception.VolumeBackendAPIException,
|
self.assertRaises(exception.VolumeBackendAPIException,
|
||||||
self.httpclient._wait_for_async_complete,
|
self.httpclient._wait_for_async_complete,
|
||||||
self.ASYNCTASK)
|
self.ASYNCTASK)
|
||||||
|
@ -31,6 +31,10 @@ from cinder import utils
|
|||||||
LOG = logging.getLogger(__name__)
|
LOG = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
class DellDriverRetryableException(exception.VolumeBackendAPIException):
|
||||||
|
message = _("Retryable Dell Exception encountered")
|
||||||
|
|
||||||
|
|
||||||
class PayloadFilter(object):
|
class PayloadFilter(object):
|
||||||
"""PayloadFilter
|
"""PayloadFilter
|
||||||
|
|
||||||
@ -229,7 +233,7 @@ class HttpClient(object):
|
|||||||
return rest_response
|
return rest_response
|
||||||
|
|
||||||
@utils.retry(exceptions=(requests.ConnectionError,
|
@utils.retry(exceptions=(requests.ConnectionError,
|
||||||
exception.DellDriverRetryableException))
|
DellDriverRetryableException))
|
||||||
def get(self, url):
|
def get(self, url):
|
||||||
LOG.debug('get: %(url)s', {'url': url})
|
LOG.debug('get: %(url)s', {'url': url})
|
||||||
rest_response = self.session.get(self.__formatUrl(url),
|
rest_response = self.session.get(self.__formatUrl(url),
|
||||||
@ -240,7 +244,7 @@ class HttpClient(object):
|
|||||||
if (rest_response and rest_response.status_code == (
|
if (rest_response and rest_response.status_code == (
|
||||||
http_client.BAD_REQUEST)) and (
|
http_client.BAD_REQUEST)) and (
|
||||||
'Unhandled Exception' in rest_response.text):
|
'Unhandled Exception' in rest_response.text):
|
||||||
raise exception.DellDriverRetryableException()
|
raise DellDriverRetryableException()
|
||||||
return rest_response
|
return rest_response
|
||||||
|
|
||||||
@utils.retry(exceptions=(requests.ConnectionError,))
|
@utils.retry(exceptions=(requests.ConnectionError,))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user