aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/workflow_manager.py
diff options
context:
space:
mode:
authorSawyer Bergeron <sbergeron@iol.unh.edu>2020-05-15 14:58:37 -0400
committerSawyer Bergeron <sbergeron@iol.unh.edu>2020-05-15 17:42:23 -0400
commit530271c247a4ce538e3aa69fd3893481fada44ab (patch)
tree48640138c825bf0906a1c261c28939d5311ae6d6 /src/workflow/workflow_manager.py
parent6bf37e9864787e0398a1d2e1cdd10b40a8ebc6e6 (diff)
Merge resource branch
This pulls master up to date to include changes to models and surrounding infra that allow for multi-node templates and merging of pods Squashed commit of the following: commit abc8f27d9c6b05fb3afcb9b00dc35c0f2232d1a6 Author: Sawyer Bergeron <sawyerbergeron@gmail.com> Date: Thu Apr 2 14:05:26 2020 -0400 Start fixing workflow for model changes Change-Id: I79df975ef45abf2e6e69594d358bbd205938828f Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.com> Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> commit 7a7e2182acd0ea94e19aba4926c3a12771b30a6d Author: sms1097 <ssmith@iol.unh.edu> Date: Tue Mar 31 15:13:06 2020 -0400 Working on workflow refactoring Change-Id: I4141b6aca98aff7bff9cb78a7d5594e25eb45e98 Signed-off-by: Sean Smith <ssmith@iol.unh.edu> commit c09050ae2814f07af58557b40f9ed3559063d2c7 Merge: 71438d9 b5ccdc4 Author: Parker Berberian <pberberian@iol.unh.edu> Date: Tue Mar 24 20:34:16 2020 +0000 Merge "Able to delete configurations and view lab details" into resource commit b5ccdc4ffbb883c20f2f6f69aeef5002aef5db53 Author: sms1097 <ssmith@iol.unh.edu> Date: Thu Mar 19 17:08:12 2020 -0400 Able to delete configurations and view lab details Change-Id: Ib15c86d84f4cc7e7745551889ce91c89b5de46e2 Signed-off-by: Sean Smith <ssmith@iol.unh.edu> Change-Id: Id6748c6bea67773a861921394d88579730246598 commit 71438d9a35cdb316cece865c9d410aeffb0053d8 Merge: 5460d0d a758223 Author: Parker Berberian <pberberian@iol.unh.edu> Date: Thu Mar 19 18:51:09 2020 +0000 Merge "Add / Fix tests for refactor" into resource commit 5460d0d447b075433a763f9bfa33448b88ec8393 Merge: a9063a3 f55d839 Author: Parker Berberian <pberberian@iol.unh.edu> Date: Wed Mar 18 15:59:37 2020 +0000 Merge "Fixed the quick booking form resource template filtering. Added some more models to the admin page." into resource commit f55d839a029ab1f5ab1273872e71a97fa1d5108b Author: Adam Hassick <ahassick@iol.unh.edu> Date: Tue Mar 17 11:35:40 2020 -0400 Fixed the quick booking form resource template filtering. Added some more models to the admin page. Signed-off-by: Adam Hassick <ahassick@iol.unh.edu> Change-Id: I2d2e7aeb96b10c231804a62f37a476039c954b7b commit a9063a347c4ebef0e53a17f198468bb135772810 Author: Parker Berberian <pberberian@iol.unh.edu> Date: Wed Mar 18 10:29:51 2020 -0400 Fixes Some Issues with Quick Booking Seen in the Akraino lab Signed-off-by: Parker Berberian <pberberian@iol.unh.edu> Change-Id: I2a1e843fbaa7984225f2f80742dad59dc348fbf2 commit a758223f44c6fec595b055d7c9b232b00e9174a0 Author: Parker Berberian <pberberian@iol.unh.edu> Date: Tue Mar 17 11:07:32 2020 -0400 Add / Fix tests for refactor Change-Id: I0526d1942f87707082a4eb1c8c98910f84481c23 Signed-off-by: Parker Berberian <pberberian@iol.unh.edu> Author: Parker Berberian <pberberian@iol.unh.edu> Add "Pod" Column to booking list Signed-off-by: Parker Berberian <pberberian@iol.unh.edu> Change-Id: I270913283bf1e5815cadf622ba2fd5f98bb61675 Author: Parker Berberian <pberberian@iol.unh.edu> Fixes that make the Akraino dashboard work Signed-off-by: Parker Berberian <pberberian@iol.unh.edu> Change-Id: I81746473a4511ef7d46445a7b16809a6e9da100f Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu> Change-Id: I4b428e7c8a8d401d7bae95cba01077feb0332a7f Signed-off-by: Sawyer Bergeron <sbergeron@iol.unh.edu>
Diffstat (limited to 'src/workflow/workflow_manager.py')
-rw-r--r--src/workflow/workflow_manager.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/workflow/workflow_manager.py b/src/workflow/workflow_manager.py
index e31e14c..a48efe5 100644
--- a/src/workflow/workflow_manager.py
+++ b/src/workflow/workflow_manager.py
@@ -66,7 +66,7 @@ class SessionManager():
return reverse('booking:booking_detail', kwargs={'booking_id': self.result.id})
return "/"
- def pop_workflow(self):
+ def pop_workflow(self, discard=False):
multiple_wfs = len(self.workflows) > 1
if multiple_wfs:
if self.workflows[-1].repository.el[Repository.RESULT]: # move result
@@ -79,6 +79,8 @@ class SessionManager():
else:
current_repo = prev_workflow.repository
self.result = current_repo.el[current_repo.RESULT]
+ if discard:
+ current_repo.cancel()
return multiple_wfs, self.result
def status(self, request):
@@ -164,14 +166,14 @@ class SessionManager():
confirmation = self.make_booking_confirm(booking)
self.active_workflow().repository.el[self.active_workflow().repository.BOOKING_MODELS] = models
self.active_workflow().repository.el[self.active_workflow().repository.CONFIRMATION] = confirmation
- self.active_workflow().repository.el[self.active_workflow().repository.GRESOURCE_BUNDLE_MODELS] = self.make_grb_models(booking.resource.template)
- self.active_workflow().repository.el[self.active_workflow().repository.SELECTED_GRESOURCE_BUNDLE] = self.make_grb_models(booking.resource.template)['bundle']
+ self.active_workflow().repository.el[self.active_workflow().repository.RESOURCE_TEMPLATE_MODELS] = self.make_grb_models(booking.resource.template)
+ self.active_workflow().repository.el[self.active_workflow().repository.SELECTED_RESOURCE_TEMPLATE] = self.make_grb_models(booking.resource.template)['bundle']
self.active_workflow().repository.el[self.active_workflow().repository.CONFIG_MODELS] = self.make_config_models(booking.config_bundle)
def prefill_resource(self, resource):
models = self.make_grb_models(resource)
confirm = self.make_grb_confirm(resource)
- self.active_workflow().repository.el[self.active_workflow().repository.GRESOURCE_BUNDLE_MODELS] = models
+ self.active_workflow().repository.el[self.active_workflow().repository.RESOURCE_TEMPLATE_MODELS] = models
self.active_workflow().repository.el[self.active_workflow().repository.CONFIRMATION] = confirm
def prefill_config(self, config):
@@ -180,10 +182,10 @@ class SessionManager():
self.active_workflow().repository.el[self.active_workflow().repository.CONFIG_MODELS] = models
self.active_workflow().repository.el[self.active_workflow().repository.CONFIRMATION] = confirm
grb_models = self.make_grb_models(config.bundle)
- self.active_workflow().repository.el[self.active_workflow().repository.GRESOURCE_BUNDLE_MODELS] = grb_models
+ self.active_workflow().repository.el[self.active_workflow().repository.RESOURCE_TEMPLATE_MODELS] = grb_models
def make_grb_models(self, resource):
- models = self.active_workflow().repository.el.get(self.active_workflow().repository.GRESOURCE_BUNDLE_MODELS, {})
+ models = self.active_workflow().repository.el.get(self.active_workflow().repository.RESOURCE_TEMPLATE_MODELS, {})
models['hosts'] = []
models['bundle'] = resource
models['interfaces'] = {}