Dell Powerflex: Add new VOLUME_NOT_MAPPED_ERROR
Dell Powerflex 4.x changed the error code of VOLUME_NOT_MAPPED_ERROR
to 4039. This patch adds that error code.
Closes-Bug: #2046810
Change-Id: I76aa9e353747b1651480efb0f3de11c707fe5abe
(cherry picked from commit 97e89d8578
)
This commit is contained in:
parent
c8e7dfbb47
commit
977b8431ee
|
@ -48,6 +48,7 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
||||||
|
|
||||||
OK_STATUS_CODE = 200
|
OK_STATUS_CODE = 200
|
||||||
VOLUME_NOT_MAPPED_ERROR = 84
|
VOLUME_NOT_MAPPED_ERROR = 84
|
||||||
|
VOLUME_NOT_MAPPED_ERROR_v4 = 4039
|
||||||
VOLUME_ALREADY_MAPPED_ERROR = 81
|
VOLUME_ALREADY_MAPPED_ERROR = 81
|
||||||
VOLUME_ALREADY_MAPPED_ERROR_v4 = 4037
|
VOLUME_ALREADY_MAPPED_ERROR_v4 = 4037
|
||||||
GET_GUID_OP_CODE = io('a', 14)
|
GET_GUID_OP_CODE = io('a', 14)
|
||||||
|
@ -516,7 +517,8 @@ class ScaleIOConnector(base.BaseLinuxConnector):
|
||||||
if r.status_code != self.OK_STATUS_CODE:
|
if r.status_code != self.OK_STATUS_CODE:
|
||||||
response = r.json()
|
response = r.json()
|
||||||
error_code = response['errorCode']
|
error_code = response['errorCode']
|
||||||
if error_code == self.VOLUME_NOT_MAPPED_ERROR:
|
if error_code == self.VOLUME_NOT_MAPPED_ERROR or \
|
||||||
|
error_code == self.VOLUME_NOT_MAPPED_ERROR_v4:
|
||||||
LOG.warning(
|
LOG.warning(
|
||||||
"Ignoring error unmapping volume %(volume_id)s: "
|
"Ignoring error unmapping volume %(volume_id)s: "
|
||||||
"volume not mapped.", {'volume_id': self.volume_name}
|
"volume not mapped.", {'volume_id': self.volume_name}
|
||||||
|
|
|
@ -269,6 +269,15 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
||||||
|
|
||||||
self.assertRaises(exception.BrickException, self.test_connect_volume)
|
self.assertRaises(exception.BrickException, self.test_connect_volume)
|
||||||
|
|
||||||
|
def test_error_map_volume_v4(self):
|
||||||
|
"""Fail to connect with REST API failure (v4)"""
|
||||||
|
self.mock_calls[self.action_format.format(
|
||||||
|
'addMappedSdc')] = self.MockHTTPSResponse(
|
||||||
|
dict(errorCode=self.connector.VOLUME_NOT_MAPPED_ERROR_v4,
|
||||||
|
message='Test error map volume'), 500)
|
||||||
|
|
||||||
|
self.assertRaises(exception.BrickException, self.test_connect_volume)
|
||||||
|
|
||||||
@mock.patch('os_brick.utils._time_sleep')
|
@mock.patch('os_brick.utils._time_sleep')
|
||||||
def test_error_path_not_found(self, sleep_mock):
|
def test_error_path_not_found(self, sleep_mock):
|
||||||
"""Timeout waiting for volume to map to local file system"""
|
"""Timeout waiting for volume to map to local file system"""
|
||||||
|
@ -313,6 +322,15 @@ class ScaleIOConnectorTestCase(test_connector.ConnectorTestCase):
|
||||||
|
|
||||||
self.test_disconnect_volume()
|
self.test_disconnect_volume()
|
||||||
|
|
||||||
|
def test_disconnect_volume_not_mapped_v4(self):
|
||||||
|
"""Ignore REST API failure for volume not mapped (v4)"""
|
||||||
|
self.mock_calls[self.action_format.format(
|
||||||
|
'removeMappedSdc')] = self.MockHTTPSResponse(
|
||||||
|
dict(errorCode=self.connector.VOLUME_NOT_MAPPED_ERROR_v4,
|
||||||
|
message='Test error map volume'), 500)
|
||||||
|
|
||||||
|
self.test_disconnect_volume()
|
||||||
|
|
||||||
@mock.patch.object(os.path, 'exists', return_value=True)
|
@mock.patch.object(os.path, 'exists', return_value=True)
|
||||||
@mock.patch.object(scaleio.ScaleIOConnector, '_find_volume_path')
|
@mock.patch.object(scaleio.ScaleIOConnector, '_find_volume_path')
|
||||||
@mock.patch('os_brick.utils.get_device_size')
|
@mock.patch('os_brick.utils.get_device_size')
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
---
|
||||||
|
fixes:
|
||||||
|
- |
|
||||||
|
Dell PowerFlex driver `Bug #2046810
|
||||||
|
<https://bugs.launchpad.net/os-brick/+bug/2046810>`_: Added
|
||||||
|
new error code for PowerFlex 4.x which was causing this error.
|
||||||
|
Added handling for the new error code returned from PowerFlex
|
||||||
|
v4.x and allow the driver to ignore and skip a disconnect
|
||||||
|
operation when the volume is not mapped.
|
Loading…
Reference in New Issue