aboutsummaryrefslogtreecommitdiffstats
path: root/src/workflow/sw_bundle_workflow.py
diff options
context:
space:
mode:
authorParker Berberian <pberberian@iol.unh.edu>2019-05-31 20:01:57 +0000
committerGerrit Code Review <gerrit@opnfv.org>2019-05-31 20:01:57 +0000
commitbe541f2ae9e8415a156f3dc7f6796e7c90749181 (patch)
tree949cb518d8a0fb59244e750992e6752cac751a95 /src/workflow/sw_bundle_workflow.py
parent6b8115d7ac8412c9d0ba6899062969b636ed9149 (diff)
parent63bec7d84cbf1acd3a9a357b58b47584b1701229 (diff)
Merge "Refactor selector step logic"
Diffstat (limited to 'src/workflow/sw_bundle_workflow.py')
-rw-r--r--src/workflow/sw_bundle_workflow.py19
1 files changed, 3 insertions, 16 deletions
diff --git a/src/workflow/sw_bundle_workflow.py b/src/workflow/sw_bundle_workflow.py
index 329b716..0c558fc 100644
--- a/src/workflow/sw_bundle_workflow.py
+++ b/src/workflow/sw_bundle_workflow.py
@@ -12,25 +12,12 @@ from django.forms import formset_factory
from workflow.models import WorkflowStep
from workflow.forms import BasicMetaForm, HostSoftwareDefinitionForm
-from workflow.booking_workflow import Resource_Select
+from workflow.booking_workflow import Abstract_Resource_Select
from resource_inventory.models import Image, GenericHost, ConfigBundle, HostConfiguration
-# resource selection step is reused from Booking workflow
-class SWConf_Resource_Select(Resource_Select):
- def __init__(self, *args, **kwargs):
- super(SWConf_Resource_Select, self).__init__(*args, **kwargs)
- self.repo_key = self.repo.SELECTED_GRESOURCE_BUNDLE
- self.confirm_key = "configuration"
-
- def post_render(self, request):
- response = super(SWConf_Resource_Select, self).post_render(request)
- models = self.repo_get(self.repo.CONFIG_MODELS, {})
- bundle = models.get("bundle", ConfigBundle(owner=self.repo_get(self.repo.SESSION_USER)))
- bundle.bundle = self.repo_get(self.repo_key) # super put grb here
- models['bundle'] = bundle
- self.repo_put(self.repo.CONFIG_MODELS, models)
- return response
+class SWConf_Resource_Select(Abstract_Resource_Select):
+ workflow_type = "configuration"
class Define_Software(WorkflowStep):