ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a...@apache.org
Subject [1/4] incubator-ariatosca git commit: ARIA-230 Dry execution doesn't log empty operations [Forced Update!]
Date Tue, 09 May 2017 13:47:58 GMT
Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-210-handle-relative-paths-in-cli-service-templates 0a3ea7991 -> 66727c395
(forced update)


ARIA-230 Dry execution doesn't log empty operations


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

Branch: refs/heads/ARIA-210-handle-relative-paths-in-cli-service-templates
Commit: b11fbc946ae6d26ad6c70a283cc6d6501c320273
Parents: 0ec2370
Author: max-orlov <maxim@gigaspaces.com>
Authored: Mon May 8 17:29:29 2017 +0300
Committer: max-orlov <maxim@gigaspaces.com>
Committed: Tue May 9 01:02:46 2017 +0300

----------------------------------------------------------------------
 aria/orchestrator/workflows/executor/dry.py | 26 ++++++++++++------------
 1 file changed, 13 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/b11fbc94/aria/orchestrator/workflows/executor/dry.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/workflows/executor/dry.py b/aria/orchestrator/workflows/executor/dry.py
index f6fb7a6..63ec392 100644
--- a/aria/orchestrator/workflows/executor/dry.py
+++ b/aria/orchestrator/workflows/executor/dry.py
@@ -32,20 +32,20 @@ class DryExecutor(BaseExecutor):
             task.started_at = datetime.utcnow()
             task.status = task.STARTED
 
+        dry_msg = '<dry> {name} {task.interface_name}.{task.operation_name} {suffix}'
+        logger = task.context.logger.info if task.implementation else task.context.logger.debug
+
+        if hasattr(task.actor, 'source_node'):
+            name = '{source_node.name}->{target_node.name}'.format(
+                source_node=task.actor.source_node, target_node=task.actor.target_node)
+        else:
+            name = task.actor.name
+
         if task.implementation:
-            if hasattr(task.actor, 'source_node'):
-                name = '{source_node.name}->{target_node.name}'.format(
-                    source_node=task.actor.source_node, target_node=task.actor.target_node)
-            else:
-                name = task.actor.name
-
-            task.context.logger.info(
-                '<dry> {name} {task.interface_name}.{task.operation_name} started...'
-                .format(name=name, task=task))
-
-            task.context.logger.info(
-                '<dry> {name} {task.interface_name}.{task.operation_name} successful'
-                .format(name=name, task=task))
+            logger(dry_msg.format(name=name, task=task, suffix='started...'))
+            logger(dry_msg.format(name=name, task=task, suffix='successful'))
+        else:
+            logger(dry_msg.format(name=name, task=task, suffix='has no implementation'))
 
         # updating the task manually instead of calling self._task_succeeded(task),
         # to avoid any side effects raising that event might cause


Mime
View raw message