diff --git a/tuskar_ui/infrastructure/overview/forms.py b/tuskar_ui/infrastructure/overview/forms.py index 72449db63..b0eb5b342 100644 --- a/tuskar_ui/infrastructure/overview/forms.py +++ b/tuskar_ui/infrastructure/overview/forms.py @@ -283,6 +283,10 @@ class ScaleOut(EditPlan): class DeployOvercloud(horizon.forms.SelfHandlingForm): + network_isolation = horizon.forms.BooleanField( + label=_("Enable Network Isolation"), + required=False) + def handle(self, request, data): try: plan = api.tuskar.Plan.get_the_plan(request) @@ -292,6 +296,21 @@ class DeployOvercloud(horizon.forms.SelfHandlingForm): _("Unable to deploy overcloud.")) return False + # If network isolation selected, read environment file data + # and add to plan + env_temp = '/usr/share/openstack-tripleo-heat-templates/environments' + try: + if self.cleaned_data['network_isolation']: + with open(env_temp, 'r') as env_file: + env_contents = ''.join( + [line for line in + env_file.readlines() if '#' not in line] + ) + plan.environment += env_contents + except Exception as e: + LOG.exception(e) + pass + # Auto-generate missing passwords and certificates if plan.list_generated_parameters(): generated_params = plan.make_generated_parameters() diff --git a/tuskar_ui/infrastructure/templates/infrastructure/overview/_deploy_confirmation.html b/tuskar_ui/infrastructure/templates/infrastructure/overview/_deploy_confirmation.html index 2b7d1f6e8..b3daed670 100644 --- a/tuskar_ui/infrastructure/templates/infrastructure/overview/_deploy_confirmation.html +++ b/tuskar_ui/infrastructure/templates/infrastructure/overview/_deploy_confirmation.html @@ -23,6 +23,13 @@ {% endif %} + +
+
+
+ {% include "horizon/common/_form_fields.html" %} +
+