linting
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/3dbe5b3c Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/3dbe5b3c Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/3dbe5b3c Branch: refs/heads/ARIA-408-Remove-execution-creation-from-WorkflowRunner Commit: 3dbe5b3cf5900bf9e2ce3d4656762ac8c882043f Parents: 9e844fc Author: max-orlov <[email protected]> Authored: Mon Nov 20 16:55:14 2017 +0200 Committer: max-orlov <[email protected]> Committed: Mon Nov 20 16:55:14 2017 +0200 ---------------------------------------------------------------------- aria/cli/commands/executions.py | 8 ++++---- aria/orchestrator/execution_compiler.py | 8 ++++---- tests/orchestrator/execution/test_execution_compiler.py | 3 ++- .../workflows/core/test_task_graph_into_execution_graph.py | 2 +- 4 files changed, 11 insertions(+), 10 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/aria/cli/commands/executions.py ---------------------------------------------------------------------- diff --git a/aria/cli/commands/executions.py b/aria/cli/commands/executions.py index f2e9145..be5dab9 100644 --- a/aria/cli/commands/executions.py +++ b/aria/cli/commands/executions.py @@ -146,10 +146,10 @@ def start(workflow_name, executor = DryExecutor() if dry else ProcessExecutor(plugin_manager=plugin_manager) compiler = execution_compiler.ExecutionCompiler( - model_storage, - resource_storage, - plugin_manager, - service, + model_storage, + resource_storage, + plugin_manager, + service, workflow_name ) workflow_ctx = compiler.compile(inputs, executor=executor) http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/aria/orchestrator/execution_compiler.py ---------------------------------------------------------------------- diff --git a/aria/orchestrator/execution_compiler.py b/aria/orchestrator/execution_compiler.py index 01e35c1..f86e6b3 100644 --- a/aria/orchestrator/execution_compiler.py +++ b/aria/orchestrator/execution_compiler.py @@ -92,9 +92,9 @@ class ExecutionCompiler(object): if len(self._execution.tasks) == 0: workflow_fn = self._get_workflow_fn(self._execution.workflow_name) - self._tasks_graph = workflow_fn(ctx=self.workflow_ctx, **execution_inputs_dict) + tasks_graph = workflow_fn(ctx=self.workflow_ctx, **execution_inputs_dict) compiler = graph_compiler.GraphCompiler(self.workflow_ctx, executor.__class__) - compiler.compile(self._tasks_graph) + compiler.compile(tasks_graph) def _create_execution_model(self, inputs=None): self._validate_workflow_exists_for_service() @@ -126,14 +126,14 @@ class ExecutionCompiler(object): if active_executions: raise exceptions.ActiveExecutionsError( "Can't start execution; Service {0} has an active execution with ID {1}" - .format(self._service.name, active_executions[0].id)) + .format(self._service.name, active_executions[0].id)) def _validate_workflow_exists_for_service(self): if self._workflow_name not in self._service.workflows and \ self._workflow_name not in builtin.BUILTIN_WORKFLOWS: raise exceptions.UndeclaredWorkflowError( 'No workflow policy {0} declared in service {1}' - .format(self._workflow_name, self._service.name)) + .format(self._workflow_name, self._service.name)) def _get_workflow_fn(self, workflow_name): if workflow_name in builtin.BUILTIN_WORKFLOWS: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/tests/orchestrator/execution/test_execution_compiler.py ---------------------------------------------------------------------- diff --git a/tests/orchestrator/execution/test_execution_compiler.py b/tests/orchestrator/execution/test_execution_compiler.py index 14332db..6062686 100644 --- a/tests/orchestrator/execution/test_execution_compiler.py +++ b/tests/orchestrator/execution/test_execution_compiler.py @@ -91,7 +91,8 @@ def test_custom_workflow_instantiation(request): # (expecting no errors to be raised on undeclared workflow or missing workflow implementation) mock_workflow = _setup_mock_workflow_in_service(request) workflow_ctx = _get_compiler(request, mock_workflow).compile() - assert len(workflow_ctx.execution.tasks) == 2 # mock workflow creates only start workflow and end workflow task + assert len(workflow_ctx.execution.tasks) == 2 # mock workflow creates only start workflow + # and end workflow task def test_existing_active_executions(request, service, model): http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/3dbe5b3c/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py ---------------------------------------------------------------------- diff --git a/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py b/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py index 7f2b7c6..9f072f6 100644 --- a/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py +++ b/tests/orchestrator/workflows/core/test_task_graph_into_execution_graph.py @@ -99,7 +99,7 @@ def test_task_graph_into_execution_graph(tmpdir): '{0}-End'.format(test_task_graph.id) ] - # assert expected_tasks_names == [compiler._model_to_api_id[t.id] for t in execution_tasks] + assert expected_tasks_names == [compiler._model_to_api_id[t.id] for t in execution_tasks] assert all(isinstance(task, models.Task) for task in execution_tasks) execution_tasks = iter(execution_tasks)
