Merge "Fixing task/workflow specs to do transformations with 'on-XXX' once"
This commit is contained in:
commit
22953c168b
@ -60,6 +60,9 @@ class TaskSpec(base.BaseSpec):
|
||||
task_policies.TaskPoliciesSpec
|
||||
)
|
||||
self._requires = data.get('requires', [])
|
||||
self._on_complete = self._as_list_of_tuples('on-complete')
|
||||
self._on_success = self._as_list_of_tuples('on-success')
|
||||
self._on_error = self._as_list_of_tuples('on-error')
|
||||
|
||||
self._process_action_and_workflow()
|
||||
|
||||
@ -112,13 +115,13 @@ class TaskSpec(base.BaseSpec):
|
||||
return self._requires
|
||||
|
||||
def get_on_complete(self):
|
||||
return self._as_list_of_tuples('on-complete')
|
||||
return self._on_complete
|
||||
|
||||
def get_on_success(self):
|
||||
return self._as_list_of_tuples('on-success')
|
||||
return self._on_success
|
||||
|
||||
def get_on_error(self):
|
||||
return self._as_list_of_tuples('on-error')
|
||||
return self._on_error
|
||||
|
||||
|
||||
class TaskSpecList(base.BaseSpecList):
|
||||
|
@ -49,6 +49,9 @@ class WorkflowSpec(base.BaseSpec):
|
||||
self._output = data.get('output', {})
|
||||
# TODO(rakhmerov): Build workflow policies specification.
|
||||
self._policies = None
|
||||
self._on_task_complete = self._as_list_of_tuples("on-task-complete")
|
||||
self._on_task_success = self._as_list_of_tuples("on-task-success")
|
||||
self._on_task_error = self._as_list_of_tuples("on-task-error")
|
||||
|
||||
self._tasks = self._spec_property('tasks', tasks.TaskSpecList)
|
||||
|
||||
@ -71,13 +74,13 @@ class WorkflowSpec(base.BaseSpec):
|
||||
return self._policies
|
||||
|
||||
def get_on_task_complete(self):
|
||||
return self._as_list_of_tuples("on-task-complete")
|
||||
return self._on_task_complete
|
||||
|
||||
def get_on_task_success(self):
|
||||
return self._as_list_of_tuples("on-task-success")
|
||||
return self._on_task_success
|
||||
|
||||
def get_on_task_error(self):
|
||||
return self._as_list_of_tuples("on-task-error")
|
||||
return self._on_task_error
|
||||
|
||||
def get_tasks(self):
|
||||
return self._tasks
|
||||
|
Loading…
Reference in New Issue
Block a user