Repository: incubator-ariatosca Updated Branches: refs/heads/ARIA-408-Remove-execution-creation-from-WorkflowRunner 1f576e868 -> 1e4346d8d (forced update)
review 2 Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/1e4346d8 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/1e4346d8 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/1e4346d8 Branch: refs/heads/ARIA-408-Remove-execution-creation-from-WorkflowRunner Commit: 1e4346d8d75756f16ab4bdd30a46f85ffb66f866 Parents: 705e81b Author: max-orlov <[email protected]> Authored: Tue Nov 21 17:47:36 2017 +0200 Committer: max-orlov <[email protected]> Committed: Tue Nov 21 18:48:18 2017 +0200 ---------------------------------------------------------------------- aria/orchestrator/execution_preparer.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1e4346d8/aria/orchestrator/execution_preparer.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/execution_preparer.py b/aria/orchestrator/execution_preparer.py index c59ae44..7513ebe 100644 --- a/aria/orchestrator/execution_preparer.py +++ b/aria/orchestrator/execution_preparer.py @@ -38,7 +38,7 @@ class ExecutionPreparer(object): def __init__( self, model_storage, - resource_storagee, + resource_storage, plugin_manager, service, workflow_name, @@ -46,14 +46,14 @@ class ExecutionPreparer(object): task_retry_interval=None ): self._model = model_storage - self._resource = resource_storagee + self._resource = resource_storage self._plugin = plugin_manager self._service = service self._workflow_name = workflow_name self._task_max_attempts = task_max_attempts or DEFAULT_TASK_MAX_ATTEMPTS self._task_retry_interval = task_retry_interval or DEFAULT_TASK_RETRY_INTERVAL - def get_ctx(self, execution): + def get_workflow_ctx(self, execution): return WorkflowContext( name=self._workflow_name, model_storage=self._model, @@ -67,11 +67,10 @@ class ExecutionPreparer(object): def prepare(self, execution_inputs=None, executor=None, execution_id=None): """ - Prepares the execution and return the workflow ctx. If the execution is new, an execution - and tasks models would be created. A workflow context for the appropriate execution would - be created. + If there is a need to prepare a new prepare execution (e.g. execution id is not provided), + a new execution and task models are created. A corresponding workflow context is returned. - :param execution_inputs: Inputs for the execution. + :param execution_inputs: inputs for the execution. :param executor: the execution for the tasks :param execution_id: used for an existing execution (mainly for resuming). :return: @@ -82,13 +81,13 @@ class ExecutionPreparer(object): # If the execution is new execution = self._create_execution_model(execution_inputs) self._model.execution.put(execution) - ctx = self.get_ctx(execution) + ctx = self.get_workflow_ctx(execution) self._create_tasks(ctx, executor) self._model.execution.update(execution) else: # If resuming an execution execution = self._model.execution.get(execution_id) - ctx = self.get_ctx(execution) + ctx = self.get_workflow_ctx(execution) return ctx
