Merge "Fix validation for master_lb_enabled"
This commit is contained in:
commit
f2aae8834e
@ -209,7 +209,7 @@ def validate_os_resources(context, cluster_template, cluster=None):
|
||||
|
||||
def validate_master_count(cluster, cluster_template):
|
||||
if cluster['master_count'] > 1 and \
|
||||
not cluster_template['master_lb_enabled']:
|
||||
not cluster['master_lb_enabled']:
|
||||
raise exception.InvalidParameterValue(_(
|
||||
"master_count must be 1 when master_lb_enabled is False"))
|
||||
|
||||
|
@ -803,7 +803,7 @@ class TestPost(api_base.FunctionalTest):
|
||||
cluster_template = obj_utils.create_test_cluster_template(
|
||||
self.context, name='foo', uuid='foo', master_lb_enabled=False)
|
||||
bdict = apiutils.bay_post_data(baymodel_id=cluster_template.name,
|
||||
master_count=3)
|
||||
master_count=3, master_lb_enabled=False)
|
||||
response = self.post_json('/bays', bdict, expect_errors=True)
|
||||
self.assertEqual('application/json', response.content_type)
|
||||
self.assertEqual(400, response.status_int)
|
||||
|
@ -845,7 +845,8 @@ class TestPost(api_base.FunctionalTest):
|
||||
cluster_template = obj_utils.create_test_cluster_template(
|
||||
self.context, name='foo', uuid='foo', master_lb_enabled=False)
|
||||
bdict = apiutils.cluster_post_data(
|
||||
cluster_template_id=cluster_template.name, master_count=3)
|
||||
cluster_template_id=cluster_template.name, master_count=3,
|
||||
master_lb_enabled=False)
|
||||
response = self.post_json('/clusters', bdict, expect_errors=True)
|
||||
self.assertEqual('application/json', response.content_type)
|
||||
self.assertEqual(400, response.status_int)
|
||||
|
@ -101,7 +101,7 @@ def get_test_cluster(**kw):
|
||||
'fixed_network': kw.get('fixed_network', None),
|
||||
'fixed_subnet': kw.get('fixed_subnet', None),
|
||||
'floating_ip_enabled': kw.get('floating_ip_enabled', True),
|
||||
'master_lb_enabled': kw.get('master_lb_enabled', False),
|
||||
'master_lb_enabled': kw.get('master_lb_enabled', True),
|
||||
}
|
||||
|
||||
if kw.pop('for_api_use', False):
|
||||
|
Loading…
x
Reference in New Issue
Block a user