ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dankil...@apache.org
Subject incubator-ariatosca git commit: fixes
Date Wed, 02 Nov 2016 15:47:25 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-14-workflow-engine-tests ff5098ca8 -> 1efdef505


fixes


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

Branch: refs/heads/ARIA-14-workflow-engine-tests
Commit: 1efdef505ee82fa609a594664d1b370f3fc15a89
Parents: ff5098c
Author: Dan Kilman <dankilman@gmail.com>
Authored: Wed Nov 2 17:47:15 2016 +0200
Committer: Dan Kilman <dankilman@gmail.com>
Committed: Wed Nov 2 17:47:15 2016 +0200

----------------------------------------------------------------------
 aria/storage/models.py        | 2 +-
 aria/workflows/core/engine.py | 3 ++-
 aria/workflows/core/tasks.py  | 4 ++--
 3 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1efdef50/aria/storage/models.py
----------------------------------------------------------------------
diff --git a/aria/storage/models.py b/aria/storage/models.py
index eb6b8e8..e5fc1ac 100644
--- a/aria/storage/models.py
+++ b/aria/storage/models.py
@@ -237,7 +237,7 @@ class Operation(Model):
     id = Field(type=basestring, default=uuid_generator)
     status = Field(type=basestring, choices=STATES, default=PENDING)
     execution_id = Field(type=basestring)
-    eta = Field(type=datetime, default=0)
+    eta = Field(type=datetime, default=datetime.now)
     started_at = Field(type=datetime, default=None)
     ended_at = Field(type=datetime, default=None)
     max_retries = Field(type=int, default=0)

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1efdef50/aria/workflows/core/engine.py
----------------------------------------------------------------------
diff --git a/aria/workflows/core/engine.py b/aria/workflows/core/engine.py
index 7a2431c..5cd4604 100644
--- a/aria/workflows/core/engine.py
+++ b/aria/workflows/core/engine.py
@@ -18,6 +18,7 @@ The workflow engine. Executes workflows
 """
 
 import time
+from datetime import datetime
 
 import networkx
 
@@ -63,7 +64,7 @@ class Engine(logger.LoggerMixin):
             raise
 
     def _executable_tasks(self):
-        now = time.time()
+        now = datetime.now()
         return (task for task in self._tasks_iter()
                 if task.status == models.Operation.PENDING and
                 task.eta <= now and

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/1efdef50/aria/workflows/core/tasks.py
----------------------------------------------------------------------
diff --git a/aria/workflows/core/tasks.py b/aria/workflows/core/tasks.py
index 625802a..98d7c13 100644
--- a/aria/workflows/core/tasks.py
+++ b/aria/workflows/core/tasks.py
@@ -17,7 +17,7 @@
 Workflow tasks
 """
 
-import time
+from datetime import datetime
 
 from aria import logger
 from aria.storage import models
@@ -64,7 +64,7 @@ class BaseWorkflowTask(BaseTask):
     def __init__(self, *args, **kwargs):
         super(BaseWorkflowTask, self).__init__(*args, **kwargs)
         self.status = models.Operation.PENDING
-        self.eta = time.time()
+        self.eta = datetime.now()
 
 
 class StartWorkflowTask(BaseWorkflowTask):


Mime
View raw message