Merge "PowerMax Driver - Fix for create snapshot" into stable/ussuri

This commit is contained in:
Zuul 2021-08-25 15:10:27 +00:00 committed by Gerrit Code Review
commit b2966f2e89
6 changed files with 37 additions and 7 deletions

View File

@ -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}

View File

@ -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)}

View File

@ -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(

View File

@ -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"

View File

@ -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"

View File

@ -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.