PowerMax Driver - Fix for create snapshot
Payload response change from REST means that the Device Label no longer exists in the format expected and causes an IndexError exception. This is the case in PowerMaxOS 5978.711 and later. Closes-Bug: #1939139 Change-Id: If465bc719cea2d4e85b37527f3f7ac916b5de638 (cherry picked from commit672a0e9798
) (cherry picked from commita366ed53b1
) (cherry picked from commit37be715cc7
)
This commit is contained in:
parent
652ab0aff9
commit
a56256c3d8
|
@ -1430,6 +1430,7 @@ class PowerMaxData(object):
|
|||
|
||||
snap_device_label = ('%(dev)s:%(label)s' % {'dev': device_id,
|
||||
'label': managed_snap_id})
|
||||
|
||||
priv_snap_response = {
|
||||
'deviceName': snap_device_label, 'snapshotLnks': [],
|
||||
'snapshotSrcs': [
|
||||
|
@ -1441,6 +1442,9 @@ class PowerMaxData(object):
|
|||
'snapshotName': test_snapshot_snap_name,
|
||||
'state': 'Established'}]}
|
||||
|
||||
priv_snap_response_no_label = deepcopy(priv_snap_response)
|
||||
priv_snap_response_no_label.update({'deviceName': device_id})
|
||||
|
||||
volume_metadata = {
|
||||
'DeviceID': device_id, 'ArrayID': array, 'ArrayModel': array_model}
|
||||
|
||||
|
|
|
@ -3387,6 +3387,20 @@ class PowerMaxCommonTest(test.TestCase):
|
|||
array, device_id, snap_name)
|
||||
self.assertEqual(ref_metadata, act_metadata)
|
||||
|
||||
@mock.patch.object(
|
||||
rest.PowerMaxRest, 'get_volume_snap_info',
|
||||
return_value=(tpd.PowerMaxData.priv_snap_response_no_label))
|
||||
def test_get_snapshot_metadata_no_label(self, mck_snap):
|
||||
array = self.data.array
|
||||
device_id = self.data.device_id
|
||||
snap_name = self.data.test_snapshot_snap_name
|
||||
ref_metadata = {'SnapshotLabel': snap_name,
|
||||
'SourceDeviceID': device_id}
|
||||
|
||||
act_metadata = self.common.get_snapshot_metadata(
|
||||
array, device_id, snap_name)
|
||||
self.assertEqual(ref_metadata, act_metadata)
|
||||
|
||||
def test_update_metadata(self):
|
||||
model_update = {'provider_location': six.text_type(
|
||||
self.data.provider_location)}
|
||||
|
|
|
@ -6416,12 +6416,15 @@ class PowerMaxCommon(object):
|
|||
:returns: dict -- volume metadata
|
||||
"""
|
||||
snap_info = self.rest.get_volume_snap_info(array, device_id)
|
||||
device_name = snap_info['deviceName']
|
||||
device_label = device_name.split(':')[1]
|
||||
device_name = snap_info.get('deviceName')
|
||||
try:
|
||||
device_label = device_name.split(':')[1] if device_name else None
|
||||
except IndexError:
|
||||
device_label = None
|
||||
metadata = {'SnapshotLabel': snap_name,
|
||||
'SourceDeviceID': device_id,
|
||||
'SourceDeviceLabel': device_label}
|
||||
|
||||
'SourceDeviceID': device_id}
|
||||
if device_label:
|
||||
metadata['SourceDeviceLabel'] = device_label
|
||||
return metadata
|
||||
|
||||
def _check_and_add_tags_to_storage_array(
|
||||
|
|
|
@ -133,9 +133,10 @@ class PowerMaxFCDriver(san.SanDriver, driver.FibreChannelDriver):
|
|||
4.2.9 - Failover group volume update (#1888831)
|
||||
4.2.10 - Replica RDFG suspend fix (#1892718)
|
||||
4.2.11 - Fix non-temporary snapshot delete (#1887962)
|
||||
4.2.12 - Fix for create snapshot (#1939139)
|
||||
"""
|
||||
|
||||
VERSION = "4.2.11"
|
||||
VERSION = "4.2.12"
|
||||
|
||||
# ThirdPartySystems wiki
|
||||
CI_WIKI_NAME = "EMC_VMAX_CI"
|
||||
|
|
|
@ -138,9 +138,10 @@ class PowerMaxISCSIDriver(san.SanISCSIDriver):
|
|||
4.2.9 - Failover group volume update (#1888831)
|
||||
4.2.10 - Replica RDFG suspend fix (#1892718)
|
||||
4.2.11 - Fix non-temporary snapshot delete (#1887962)
|
||||
4.2.12 - Fix for create snapshot (#1939139)
|
||||
"""
|
||||
|
||||
VERSION = "4.2.11"
|
||||
VERSION = "4.2.12"
|
||||
|
||||
# ThirdPartySystems wiki
|
||||
CI_WIKI_NAME = "EMC_VMAX_CI"
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
PowerMax driver `bug #1939139
|
||||
<https://bugs.launchpad.net/cinder/+bug/1939139>`_: Fix
|
||||
on create snapshot operation that exists when using PowerMax OS
|
||||
5978.711 and later.
|
Loading…
Reference in New Issue