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/04 15:47:26 UTC
[3/4] incubator-ariatosca git commit: smarten up the model task
retrieval mechanism
smarten up the model task retrieval mechanism
Project: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/commit/7b48ec50
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/tree/7b48ec50
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/diff/7b48ec50
Branch: refs/heads/ARIA-160-Operation-toolbelt-unit-tests-fail-spordically
Commit: 7b48ec50170681cf480ddebf1702caf669eeede0
Parents: f3b1a2e
Author: max-orlov <ma...@gigaspaces.com>
Authored: Thu May 4 18:26:12 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Thu May 4 18:26:43 2017 +0300
----------------------------------------------------------------------
aria/orchestrator/workflows/core/task.py | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/7b48ec50/aria/orchestrator/workflows/core/task.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/core/task.py b/aria/orchestrator/workflows/core/task.py
index 0e081c2..4f86306 100644
--- a/aria/orchestrator/workflows/core/task.py
+++ b/aria/orchestrator/workflows/core/task.py
@@ -162,6 +162,7 @@ class OperationTask(BaseTask):
workdir=self._workflow_context._workdir)
self._task_id = task_model.id
self._update_fields = None
+ self._model_task = None
def execute(self):
super(OperationTask, self).execute()
@@ -188,11 +189,15 @@ class OperationTask(BaseTask):
Returns the task model in storage
:return: task in storage
"""
- return self._workflow_context.model.task.get(self._task_id)
+ if self._model_task is None:
+ self._model_task = self._workflow_context.model.task.get(self._task_id)
+ return self._model_task
@model_task.setter
def model_task(self, value):
+ self._model_task = None
self._workflow_context.model.task.put(value)
+ self._workflow_context.model.task.refresh(value)
@property
def context(self):