You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ariatosca.apache.org by mx...@apache.org on 2017/05/07 16:25:15 UTC

incubator-ariatosca git commit: wip...! [Forced Update!]

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-214-Dry-execution-changes-the-state-of-non-implemented-operations 3d36ebf12 -> eaa84b0ca (forced update)


wip...!


Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/eaa84b0c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/eaa84b0c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/eaa84b0c

Branch: refs/heads/ARIA-214-Dry-execution-changes-the-state-of-non-implemented-operations
Commit: eaa84b0cacfe5e18b6841c33b6127626e2ebcfad
Parents: bfbd86f
Author: max-orlov <ma...@gigaspaces.com>
Authored: Sun May 7 19:04:29 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Sun May 7 19:24:59 2017 +0300

----------------------------------------------------------------------
 aria/orchestrator/workflows/executor/base.py                 | 8 ++++----
 aria/orchestrator/workflows/executor/dry.py                  | 2 +-
 .../orchestrator/workflows/executor/test_process_executor.py | 2 +-
 3 files changed, 6 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/eaa84b0c/aria/orchestrator/workflows/executor/base.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/executor/base.py b/aria/orchestrator/workflows/executor/base.py
index e55c736..8682e09 100644
--- a/aria/orchestrator/workflows/executor/base.py
+++ b/aria/orchestrator/workflows/executor/base.py
@@ -33,11 +33,11 @@ class BaseExecutor(logger.LoggerMixin):
         Execute a task
         :param task: task to execute
         """
-        if getattr(task, 'model_task') and task.model_task.implementation:
+        if task.implementation:
+            self._execute(task)
+        else:
             self._task_started(task)
             self._task_succeeded(task)
-        else:
-            self._execute(task)
 
     def close(self):
         """
@@ -58,6 +58,6 @@ class BaseExecutor(logger.LoggerMixin):
         events.on_success_task_signal.send(task)
 
 
-class StubTaskExecutor(BaseExecutor):
+class StubTaskExecutor(BaseExecutor):                                                               # pylint: disable=abstract-method
     def execute(self, task):
         task.status = task.SUCCESS

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/eaa84b0c/aria/orchestrator/workflows/executor/dry.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/executor/dry.py b/aria/orchestrator/workflows/executor/dry.py
index 5a4ca73..f6fb7a6 100644
--- a/aria/orchestrator/workflows/executor/dry.py
+++ b/aria/orchestrator/workflows/executor/dry.py
@@ -21,7 +21,7 @@ from datetime import datetime
 from .base import BaseExecutor
 
 
-class DryExecutor(BaseExecutor):
+class DryExecutor(BaseExecutor):                                                                    # pylint: disable=abstract-method
     """
     Executor which dry runs tasks - prints task information without causing any side effects
     """

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/eaa84b0c/tests/orchestrator/workflows/executor/test_process_executor.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor.py b/tests/orchestrator/workflows/executor/test_process_executor.py
index 81dd691..5f240b2 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor.py
@@ -65,7 +65,7 @@ class TestProcessExecutor(object):
     def test_closed(self, executor):
         executor.close()
         with pytest.raises(RuntimeError) as exc_info:
-            executor.execute(task=MockTask(implementation=None))
+            executor.execute(task=MockTask(implementation='some.implementation'))
         assert 'closed' in exc_info.value.message