summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Brady <rbrady@redhat.com>2015-06-10 08:16:42 -0400
committerRyan Brady <rbrady@redhat.com>2015-06-10 21:22:32 -0400
commit16e13d56898fae84debc45aa3164c49386cedac1 (patch)
tree425d4a6f4924724c66194457e3575b8ed62177e0
parentac95523881bf9d3c35983ad616f358fdf2286871 (diff)
downloadtuskar-ui-16e13d56898fae84debc45aa3164c49386cedac1.tar.gz
Add Network Isolation
This patch adds the ability for the operator to selectively enable network isolation. If enabled, the network isolation environment file is read from tripleo-heat-templates and appended to the plan.environment. Change-Id: I56874f185ff9c36009e28332ad901ac2ffb1fb40
-rw-r--r--tuskar_ui/infrastructure/overview/forms.py19
-rw-r--r--tuskar_ui/infrastructure/templates/infrastructure/overview/_deploy_confirmation.html7
2 files changed, 26 insertions, 0 deletions
diff --git a/tuskar_ui/infrastructure/overview/forms.py b/tuskar_ui/infrastructure/overview/forms.py
index 72449db6..b0eb5b34 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 2b7d1f6e..b3daed67 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 @@
</li></ul>
</div>
{% endif %}
+</div>
+<div>
+ <fieldset>
+ <div class="left">
+ {% include "horizon/common/_form_fields.html" %}
+ </div>
+ </fieldset>
<br /><br />
<div class="alert alert-warning">
<i class="fa fa-exclamation-triangle fa-3x pull-left text-warning"></i>