Repository: incubator-ariatosca
Updated Branches:
refs/heads/ARIA-278-Remove-core-tasks 4c723c9c3 -> 600e54e89
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/600e54e8
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/600e54e8
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/600e54e8
Branch: refs/heads/ARIA-278-Remove-core-tasks
Commit: 600e54e89b05bb52a78bf64ec0a603d87656688a
Parents: 4c723c9
Author: max-orlov
Authored: Wed Jun 14 18:36:38 2017 +0300
Committer: max-orlov
Committed: Wed Jun 14 18:41:53 2017 +0300
--
aria/modeling/orchestration.py | 6 ++--
aria/orchestrator/workflow_runner.py| 36 ++--
aria/orchestrator/workflows/executor/base.py| 6 ++--
.../orchestrator/workflows/core/test_events.py | 5 +--
.../orchestrator/workflows/executor/__init__.py | 2 +-
.../workflows/executor/test_executor.py | 5 +--
.../workflows/executor/test_process_executor.py | 12 ---
7 files changed, 38 insertions(+), 34 deletions(-)
--
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/600e54e8/aria/modeling/orchestration.py
--
diff --git a/aria/modeling/orchestration.py b/aria/modeling/orchestration.py
index c0b7f04..6f69483 100644
--- a/aria/modeling/orchestration.py
+++ b/aria/modeling/orchestration.py
@@ -21,10 +21,8 @@ classes:
"""
# pylint: disable=no-self-argument, no-member, abstract-method
-from contextlib import contextmanager
from datetime import datetime
-from networkx import DiGraph
from sqlalchemy import (
Column,
Integer,
@@ -258,8 +256,8 @@ class TaskBase(mixins.ModelMixin):
__tablename__ = 'task'
-__private_fields__ = ['dependency_operation_task_fk',
'dependency_stub_task_fk', 'node_fk',
- 'relationship_fk', 'plugin_fk', 'execution_fk']
+__private_fields__ = ['dependency_operation_task_fk',
'dependency_stub_task_fk', 'node_fk',
+ 'relationship_fk', 'plugin_fk', 'execution_fk']
START_WORKFLOW = 'start_workflow'
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/600e54e8/aria/orchestrator/workflow_runner.py
--
diff --git a/aria/orchestrator/workflow_runner.py
b/aria/orchestrator/workflow_runner.py
index f09cb79..f0a48ad 100644
--- a/aria/orchestrator/workflow_runner.py
+++ b/aria/orchestrator/workflow_runner.py
@@ -180,9 +180,9 @@ class WorkflowRunner(object):
def get_execution_graph(execution):
graph = DiGraph()
-for task in execution.tasks:
-for dependency in task.dependencies:
-graph.add_edge(dependency, task)
+for t in execution.tasks:
+for dependency in t.dependencies:
+graph.add_edge(dependency, t)
return graph
@@ -211,8 +211,8 @@ def construct_execution_tasks(execution,
dependencies=depends_on)
for api_task in task_graph.topological_order(reverse=True):
-operation_dependencies = _get_tasks_from_dependencies(execution,
-task_graph.get_dependencies(api_task), [start_task])
+operation_dependencies = _get_tasks_from_dependencies(
+execution, task_graph.get_dependencies(api_task), [start_task])
if isinstance(api_task, task.OperationTask):
models.Task.from_api_task(api_task=api_task,
@@ -257,20 +257,20 @@ def _end_graph_suffix(api_id):
def _get_non_dependent_tasks(execution):
dependency_tasks = set()
-for task in execution.tasks:
-dependency_tasks.update(task.dependencies)
+for t in execution.tasks:
+dependency_tasks.update(t.dependencies)
return list(set(execution.tasks) - set(dependency_tasks))
def _get_tasks_from_dependencies(execution, dependencies, default=()):
-"""
-Returns task list from dependencies.
-"""
-tasks = []
-for dependency in dependencies:
-if getattr(dependency, 'actor', False):
-dependency_name = dependency.id
-else:
-dependency_name = _end_graph_suffix(dependency.id)
-tasks.extend(task for task in execution.tasks if task.api_id ==
dependency_name)
-return tasks or default
+"""
+Returns task list from dependencies.
+"""
+tasks = []
+for dependency in dependencies:
+if getattr(dependency, 'actor', False):
+dependency_name = dependency.id
+else:
+dependency_name = _end_graph_suffix(dependency.id)
+tasks.extend(task for task in execution.tasks if task.api_id ==
dependency_name)
+re