aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-11-12 12:54:20 -0500
committerBrandon Lo <lobrandon1217@gmail.com>2020-01-28 13:28:34 -0500
commit899e1a4baa95d0bc6f0eef34de66f0e257174878 (patch)
tree2fbc99070b2fe2d75135ca5f899ed14b12639856 /src/workflow
parent30a535d7e9bdc0e3cf637207c0c100a16db81586 (diff)
Begin Resource Refactor
Begins the Resource Refactor by creating new interfaces to the resources through a Resource super class and using that new interface in the api Change-Id: I15a8179bfe915d2cde6d658d056e11cbd2c70e43 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu>
Diffstat (limited to 'src/workflow')
-rw-r--r--src/workflow/models.py2
-rw-r--r--src/workflow/opnfv_workflow.py2
-rw-r--r--src/workflow/snapshot_workflow.py2
-rw-r--r--src/workflow/workflow_manager.py4
4 files changed, 5 insertions, 5 deletions
diff --git a/src/workflow/models.py b/src/workflow/models.py
index 9d1fac2..99608f6 100644
--- a/src/workflow/models.py
+++ b/src/workflow/models.py
@@ -146,7 +146,7 @@ class BookingAuthManager():
return True # admin override for this user
if Booking.objects.filter(owner=booking.owner, end__gt=timezone.now()).count() >= 3:
return False
- if len(booking.resource.template.getHosts()) < 2:
+ if len(booking.resource.template.getResources()) < 2:
return True # if they only have one server, we dont care
if repo.BOOKING_INFO_FILE not in repo.el:
return False # INFO file not provided
diff --git a/src/workflow/opnfv_workflow.py b/src/workflow/opnfv_workflow.py
index a192d6e..0cac48e 100644
--- a/src/workflow/opnfv_workflow.py
+++ b/src/workflow/opnfv_workflow.py
@@ -202,7 +202,7 @@ class Assign_Host_Roles(WorkflowStep): # taken verbatim from Define_Software in
if config is None:
context['error'] = "Please select a Configuration on the first step"
- formset = self.create_host_role_formset(hostlist=config.bundle.getHosts())
+ formset = self.create_host_role_formset(hostlist=config.bundle.getResources())
context['formset'] = formset
return context
diff --git a/src/workflow/snapshot_workflow.py b/src/workflow/snapshot_workflow.py
index 4266587..c2f4cd6 100644
--- a/src/workflow/snapshot_workflow.py
+++ b/src/workflow/snapshot_workflow.py
@@ -36,7 +36,7 @@ class Select_Host_Step(WorkflowStep):
booking_hosts[booking.id]['start'] = booking.start.strftime("%Y-%m-%d")
booking_hosts[booking.id]['end'] = booking.end.strftime("%Y-%m-%d")
booking_hosts[booking.id]['hosts'] = []
- for genericHost in booking.resource.template.getHosts():
+ for genericHost in booking.resource.template.getResources():
booking_hosts[booking.id]['hosts'].append({"name": genericHost.resource.name})
context['booking_hosts'] = booking_hosts
diff --git a/src/workflow/workflow_manager.py b/src/workflow/workflow_manager.py
index 4677829..fda105e 100644
--- a/src/workflow/workflow_manager.py
+++ b/src/workflow/workflow_manager.py
@@ -189,7 +189,7 @@ class SessionManager():
models['bundle'] = resource
models['interfaces'] = {}
models['vlans'] = {}
- for host in resource.getHosts():
+ for host in resource.getResources():
models['hosts'].append(host)
models['interfaces'][host.resource.name] = []
models['vlans'][host.resource.name] = {}
@@ -205,7 +205,7 @@ class SessionManager():
confirm['resource'] = {}
confirm['resource']['hosts'] = []
confirm['resource']['lab'] = resource.lab.lab_user.username
- for host in resource.getHosts():
+ for host in resource.getResources():
confirm['resource']['hosts'].append({"name": host.resource.name, "profile": host.profile.name})
return confirm