diff --git a/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py b/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py index 05459122664..2e1c5260fd2 100644 --- a/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py +++ b/cinder/tests/unit/volume/drivers/dell_emc/vmax/test_vmax.py @@ -4434,13 +4434,19 @@ class VMAXCommonTest(test.TestCase): device_id, host, self.data.array, self.data.srp, volume_name, False) self.assertEqual(ref_return, return_val) + host = {'host': 'HostX@Backend#Silver+SRP_1+000197800123'} + ref_return = (True, 'Silver', 'NONE') + return_val = self.common._is_valid_for_storage_assisted_migration( + device_id, host, self.data.array, + self.data.srp, volume_name, False) + self.assertEqual(ref_return, return_val) def test_is_valid_for_storage_assisted_migration_false(self): device_id = self.data.device_id volume_name = self.data.test_volume.name ref_return = (False, None, None) # IndexError - host = {'host': 'HostX@Backend#Silver+SRP_1+000197800123'} + host = {'host': 'HostX@Backend#Silver+SRP_1+000197800123+dummy+data'} return_val = self.common._is_valid_for_storage_assisted_migration( device_id, host, self.data.array, self.data.srp, volume_name, False) diff --git a/cinder/volume/drivers/dell_emc/vmax/common.py b/cinder/volume/drivers/dell_emc/vmax/common.py index 8de5edf2d07..6776782fd34 100644 --- a/cinder/volume/drivers/dell_emc/vmax/common.py +++ b/cinder/volume/drivers/dell_emc/vmax/common.py @@ -2216,10 +2216,18 @@ class VMAXCommon(object): try: info_detail = host_info.split('#') pool_details = info_detail[1].split('+') - target_slo = pool_details[0] - target_workload = pool_details[1] - target_srp = pool_details[2] - target_array_serial = pool_details[3] + if len(pool_details) == 4: + target_slo = pool_details[0] + target_workload = pool_details[1] + target_srp = pool_details[2] + target_array_serial = pool_details[3] + elif len(pool_details) == 3: + target_slo = pool_details[0] + target_srp = pool_details[1] + target_array_serial = pool_details[2] + target_workload = 'NONE' + else: + raise IndexError except IndexError: LOG.error("Error parsing array, pool, SLO and workload.") return false_ret