Fix cluster-resize API
Currently, cluster-resize engine service call will be invoked with 'strict=None' if user doesn't provide 'strict' value in request params. In that case, check_size_params will be invoked with 'strict=None' as well and cause unexpected check result. This patch tries to address this issue by setting 'strict' parameter to True by default in API layer. Change-Id: Icd6a36afbb13956f8f09d9c45bd2aeb1c9bd1d1b
This commit is contained in:
@@ -250,6 +250,8 @@ class ClusterController(wsgi.Controller):
|
||||
min_step)
|
||||
if strict is not None:
|
||||
strict = utils.parse_bool_param(consts.ADJUSTMENT_STRICT, strict)
|
||||
else:
|
||||
strict = True
|
||||
|
||||
result = self.rpc_client.cluster_resize(req.context, cluster_id,
|
||||
adj_type, number, min_size,
|
||||
|
||||
@@ -1215,7 +1215,7 @@ class ClusterControllerTest(shared.ControllerTest, base.SenlinTestCase):
|
||||
'min_size': None,
|
||||
'max_size': -1,
|
||||
'min_step': None,
|
||||
'strict': None
|
||||
'strict': True
|
||||
})
|
||||
)
|
||||
self.assertEqual(eng_resp, resp)
|
||||
@@ -1257,7 +1257,7 @@ class ClusterControllerTest(shared.ControllerTest, base.SenlinTestCase):
|
||||
'min_size': 2,
|
||||
'max_size': -1,
|
||||
'min_step': None,
|
||||
'strict': None
|
||||
'strict': True
|
||||
})
|
||||
)
|
||||
self.assertEqual(eng_resp, resp)
|
||||
|
||||
Reference in New Issue
Block a user