Set NeutronL3HA to True when number of Controllers is > 1

Change-Id: Ied3f9c49bec31af3d8af013f0240cd0af0b3b25d
This commit is contained in:
Giulio Fidente 2015-01-12 17:45:41 +01:00
parent db9f96e4bd
commit 95fa00de59

View File

@ -152,6 +152,17 @@ class EditPlan(horizon.forms.SelfHandlingForm):
(field.role.node_count_parameter_name, data[name])
for (name, field) in self.fields.items() if name.endswith('-count')
)
# NOTE(gfidente): this is a bad hack meant to magically add the
# parameter which enables Neutron L3 HA when the number of
# Controllers is > 1
try:
controller_role = self.plan.get_role_by_name('controller')
except Exception as e:
LOG.warning('Unable to find role: %s', 'controller')
else:
if parameters[controller_role.node_count_parameter_name] > 1:
l3ha_param = controller_role.parameter_prefix + 'NeutronL3HA'
parameters[l3ha_param] = 'True'
try:
self.plan = self.plan.patch(request, self.plan.uuid, parameters)
except Exception as e: