summaryrefslogtreecommitdiffstats
path: root/dashboard/src
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-01-03 19:23:05 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-01-03 19:23:05 +0000
commitdcb4146468178ea0c55d4fa357309b85a4024ee0 (patch)
treed4d7d142599e427150c69ef188f9141a823c5e14 /dashboard/src
parent1f8a428644e27a4b5b034c928a526a9a82f00527 (diff)
parent6d08bed111c21f50cbb88c2d4872ba1f9bdc4886 (diff)
Merge "Requires a Jumphost per POD"
Diffstat (limited to 'dashboard/src')
-rw-r--r--dashboard/src/workflow/sw_bundle_workflow.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/dashboard/src/workflow/sw_bundle_workflow.py b/dashboard/src/workflow/sw_bundle_workflow.py
index a9be4ea..80d1b3d 100644
--- a/dashboard/src/workflow/sw_bundle_workflow.py
+++ b/dashboard/src/workflow/sw_bundle_workflow.py
@@ -118,6 +118,7 @@ class Define_Software(WorkflowStep):
HostFormset = formset_factory(HostSoftwareDefinitionForm, extra=0)
formset = HostFormset(request.POST)
hosts = self.get_host_list()
+ has_jumphost = False
if formset.is_valid():
models['host_configs'] = []
i = 0
@@ -140,6 +141,8 @@ class Define_Software(WorkflowStep):
except:
self.metastep.set_invalid("Image " + image.name + " is not compatible with host " + host.resource.name)
role = form.cleaned_data['role']
+ if "jumphost" in role.name.lower():
+ has_jumphost = True
bundle = models['bundle']
hostConfig = HostConfiguration(
host=host,
@@ -151,6 +154,10 @@ class Define_Software(WorkflowStep):
confirm_host = {"name": host.resource.name, "image": image.name, "role": role.name}
confirm_hosts.append(confirm_host)
+ if not has_jumphost:
+ self.metastep.set_invalid('Must have at least one "Jumphost" per POD')
+ return self.render(request)
+
self.repo_put(self.repo.CONFIG_MODELS, models)
if "configuration" not in confirm:
confirm['configuration'] = {}