VMAX driver - retypes failing when workload is missing

When workload is missing from the pool_name in volume type
extra specs, retype will fail.

Change-Id: Icdba015411349c56e2f88cf5cf45d12bd2f6c0d4
Closes-Bug: #1729657
This commit is contained in:
Helen Walsh 2017-11-03 10:42:10 +00:00
parent 925bdfbb06
commit 10e533005a
2 changed files with 19 additions and 5 deletions

View File

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

View File

@ -2216,10 +2216,18 @@ class VMAXCommon(object):
try:
info_detail = host_info.split('#')
pool_details = info_detail[1].split('+')
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