Fix iopsLimit parameter in ScaleIO connector
The parameter 'iops_limit' in the ScaleIO connector is wrong. The correct parameter should be 'iopsLimit'. Because of this error, the iops of the volume will stay unlimited even if the user sets a limit on the iops. This patch fixes this error. Change-Id: I6b9212e9046bf3e2c9bbbde6354c298b359de3a6 Closes-Bug: #1521396
This commit is contained in:
parent
ebec620bb5
commit
665ffea730
|
@ -2311,7 +2311,7 @@ class ScaleIOConnector(InitiatorConnector):
|
|||
if self.bandwidth_limit is not None:
|
||||
params['bandwidthLimitInKbps'] = self.bandwidth_limit
|
||||
if self.iops_limit is not None:
|
||||
params['iops_limit'] = self.iops_limit
|
||||
params['iopsLimit'] = self.iops_limit
|
||||
|
||||
request = (
|
||||
"https://%(server_ip)s:%(server_port)s/api/instances/"
|
||||
|
|
|
@ -2143,6 +2143,18 @@ class ScaleIOConnectorTestCase(ConnectorTestCase):
|
|||
"""Fake REST server"""
|
||||
api_call = url.split(':', 2)[2].split('/', 1)[1].replace('api/', '')
|
||||
|
||||
if 'setMappedSdcLimits' in api_call:
|
||||
self.assertNotIn("iops_limit", kwargs['data'])
|
||||
if "iopsLimit" not in kwargs['data']:
|
||||
self.assertIn("bandwidthLimitInKbps",
|
||||
kwargs['data'])
|
||||
elif "bandwidthLimitInKbps" not in kwargs['data']:
|
||||
self.assertIn("iopsLimit", kwargs['data'])
|
||||
else:
|
||||
self.assertIn("bandwidthLimitInKbps",
|
||||
kwargs['data'])
|
||||
self.assertIn("iopsLimit", kwargs['data'])
|
||||
|
||||
try:
|
||||
return self.mock_calls[api_call]
|
||||
except KeyError:
|
||||
|
|
Loading…
Reference in New Issue