Merge "VMAX driver - Concurrency issues involving replicated volumes"
This commit is contained in:
commit
3e4cd3812e
@ -659,6 +659,7 @@ class VMAXCommonData(object):
|
|||||||
{"symmetrixId": array_herc,
|
{"symmetrixId": array_herc,
|
||||||
"model": "VMAXHERC",
|
"model": "VMAXHERC",
|
||||||
"ucode": "5978.1091.1092"}]
|
"ucode": "5978.1091.1092"}]
|
||||||
|
version_details = {"version": "V9.0.0.1"}
|
||||||
|
|
||||||
headroom = {"headroom": [{"headroomCapacity": 20348.29}]}
|
headroom = {"headroom": [{"headroomCapacity": 20348.29}]}
|
||||||
|
|
||||||
@ -847,6 +848,8 @@ class FakeRequestsSession(object):
|
|||||||
if job['jobId'] in url:
|
if job['jobId'] in url:
|
||||||
return_object = job
|
return_object = job
|
||||||
break
|
break
|
||||||
|
elif 'version' in url:
|
||||||
|
return_object = self.data.version_details
|
||||||
else:
|
else:
|
||||||
for symm in self.data.symmetrix:
|
for symm in self.data.symmetrix:
|
||||||
if symm['symmetrixId'] in url:
|
if symm['symmetrixId'] in url:
|
||||||
@ -1652,6 +1655,13 @@ class VMAXRestTest(test.TestCase):
|
|||||||
array_details = self.rest.get_array_serial(self.data.failed_resource)
|
array_details = self.rest.get_array_serial(self.data.failed_resource)
|
||||||
self.assertIsNone(array_details)
|
self.assertIsNone(array_details)
|
||||||
|
|
||||||
|
def test_get_uni_version(self):
|
||||||
|
version, major_version = self.rest.get_uni_version()
|
||||||
|
self.assertEqual('90', major_version)
|
||||||
|
with mock.patch.object(self.rest, '_get_request', return_value=None):
|
||||||
|
version, major_version = self.rest.get_uni_version()
|
||||||
|
self.assertIsNone(major_version)
|
||||||
|
|
||||||
def test_get_srp_by_name(self):
|
def test_get_srp_by_name(self):
|
||||||
ref_details = self.data.srp_details
|
ref_details = self.data.srp_details
|
||||||
srp_details = self.rest.get_srp_by_name(
|
srp_details = self.rest.get_srp_by_name(
|
||||||
|
@ -430,6 +430,20 @@ class VMAXRest(object):
|
|||||||
is_next_gen = True
|
is_next_gen = True
|
||||||
return is_next_gen
|
return is_next_gen
|
||||||
|
|
||||||
|
def get_uni_version(self):
|
||||||
|
"""Get the unisphere version from the server.
|
||||||
|
|
||||||
|
:return: version and major_version(e.g. ("V8.4.0.16", "84"))
|
||||||
|
"""
|
||||||
|
version, major_version = None, None
|
||||||
|
target_uri = "/%s/system/version" % U4V_VERSION
|
||||||
|
response = self._get_request(target_uri, 'version')
|
||||||
|
if response and response.get('version'):
|
||||||
|
version = response['version']
|
||||||
|
version_list = version.split('.')
|
||||||
|
major_version = version_list[0][1] + version_list[1]
|
||||||
|
return version, major_version
|
||||||
|
|
||||||
def get_srp_by_name(self, array, srp=None):
|
def get_srp_by_name(self, array, srp=None):
|
||||||
"""Returns the details of a storage pool.
|
"""Returns the details of a storage pool.
|
||||||
|
|
||||||
@ -944,8 +958,10 @@ class VMAXRest(object):
|
|||||||
:returns: volume dict
|
:returns: volume dict
|
||||||
:raises: VolumeBackendAPIException
|
:raises: VolumeBackendAPIException
|
||||||
"""
|
"""
|
||||||
|
version = self.get_uni_version()[1]
|
||||||
volume_dict = self.get_resource(
|
volume_dict = self.get_resource(
|
||||||
array, SLOPROVISIONING, 'volume', resource_name=device_id)
|
array, SLOPROVISIONING, 'volume', resource_name=device_id,
|
||||||
|
version=version)
|
||||||
if not volume_dict:
|
if not volume_dict:
|
||||||
exception_message = (_("Volume %(deviceID)s not found.")
|
exception_message = (_("Volume %(deviceID)s not found.")
|
||||||
% {'deviceID': device_id})
|
% {'deviceID': device_id})
|
||||||
|
Loading…
Reference in New Issue
Block a user