aboutsummaryrefslogtreecommitdiffstats
path: root/src/booking/quick_deployer.py
diff options
context:
space:
mode:
authorAdam Hassick <ahassick@iol.unh.edu>2021-06-29 16:49:27 -0400
committerAdam Hassick <ahassick@iol.unh.edu>2021-07-23 16:22:54 +0000
commit6ffb1fdf6ce7825770148bada5a4c54899e4ed36 (patch)
treeda5d8390a4d46a898840083a761809af47bd7f52 /src/booking/quick_deployer.py
parent49e2b407003b69551ddafa851639e83ec42a5b09 (diff)
Cobbler model changes, new endpoints
Signed-off-by: Adam Hassick <ahassick@iol.unh.edu> Change-Id: If0a94730e92747127cef121ec4930a4c8bae6c92 Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> Signed-off-by: Adam Hassick <ahassick@iol.unh.edu>
Diffstat (limited to 'src/booking/quick_deployer.py')
-rw-r--r--src/booking/quick_deployer.py20
1 files changed, 2 insertions, 18 deletions
diff --git a/src/booking/quick_deployer.py b/src/booking/quick_deployer.py
index 0a3bfc6..9e53da5 100644
--- a/src/booking/quick_deployer.py
+++ b/src/booking/quick_deployer.py
@@ -176,13 +176,6 @@ def check_invariants(request, **kwargs):
length = kwargs['length']
# check that image os is compatible with installer
if image:
- if installer or scenario:
- if installer in image.os.sup_installers.all():
- # if installer not here, we can omit that and not check for scenario
- if not scenario:
- raise ValidationError("An OPNFV Installer needs a scenario to be chosen to work properly")
- if scenario not in installer.sup_scenarios.all():
- raise ValidationError("The chosen installer does not support the chosen scenario")
if image.from_lab != lab:
raise ValidationError("The chosen image is not available at the chosen hosting lab")
# TODO
@@ -272,23 +265,14 @@ def drop_filter(user):
that installer is supported on that image
"""
installer_filter = {}
- for image in Image.objects.all():
- installer_filter[image.id] = {}
- for installer in image.os.sup_installers.all():
- installer_filter[image.id][installer.id] = 1
-
scenario_filter = {}
- for installer in Installer.objects.all():
- scenario_filter[installer.id] = {}
- for scenario in installer.sup_scenarios.all():
- scenario_filter[installer.id][scenario.id] = 1
images = Image.objects.filter(Q(public=True) | Q(owner=user))
image_filter = {}
for image in images:
image_filter[image.id] = {
'lab': 'lab_' + str(image.from_lab.lab_user.id),
- 'host_profile': str(image.host_type.id),
+ 'architecture': str(image.architecture),
'name': image.name
}
@@ -296,7 +280,7 @@ def drop_filter(user):
templates = ResourceTemplate.objects.filter(Q(public=True) | Q(owner=user))
for rt in templates:
profiles = [conf.profile for conf in rt.getConfigs()]
- resource_filter["resource_" + str(rt.id)] = [str(p.id) for p in profiles]
+ resource_filter["resource_" + str(rt.id)] = [str(p.architecture) for p in profiles]
return {
'installer_filter': json.dumps(installer_filter),