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/06/04 14:13:45 UTC

incubator-ariatosca git commit: moved default instrumentation values

Repository: incubator-ariatosca
Updated Branches:
  refs/heads/ARIA-262-Inconsistent-node-attributes-behavior ad7afa26a -> 80ae4c539


moved default instrumentation values


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

Branch: refs/heads/ARIA-262-Inconsistent-node-attributes-behavior
Commit: 80ae4c5397853e81b76cdc51d8e31b2c5e0730a8
Parents: ad7afa2
Author: max-orlov <ma...@gigaspaces.com>
Authored: Sun Jun 4 17:13:40 2017 +0300
Committer: max-orlov <ma...@gigaspaces.com>
Committed: Sun Jun 4 17:13:40 2017 +0300

----------------------------------------------------------------------
 aria/orchestrator/context/operation.py                        | 7 +++++++
 aria/orchestrator/decorators.py                               | 5 +----
 .../workflows/executor/test_process_executor_extension.py     | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/80ae4c53/aria/orchestrator/context/operation.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/context/operation.py b/aria/orchestrator/context/operation.py
index efdc04d..af7220d 100644
--- a/aria/orchestrator/context/operation.py
+++ b/aria/orchestrator/context/operation.py
@@ -29,6 +29,13 @@ class BaseOperationContext(common.BaseContext):
     Context object used during operation creation and execution
     """
 
+    INSTRUMENTATION_FIELDS = (
+        aria.modeling.models.Node.attributes,
+        aria.modeling.models.Node.properties,
+        aria.modeling.models.NodeTemplate.attributes,
+        aria.modeling.models.NodeTemplate.properties
+    )
+
     def __init__(self, task_id, actor_id, **kwargs):
         self._task_id = task_id
         self._actor_id = actor_id

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/80ae4c53/aria/orchestrator/decorators.py
----------------------------------------------------------------------
diff --git a/aria/orchestrator/decorators.py b/aria/orchestrator/decorators.py
index 77cec91..39bf853 100644
--- a/aria/orchestrator/decorators.py
+++ b/aria/orchestrator/decorators.py
@@ -74,10 +74,7 @@ def operation(func=None, toolbelt=False, suffix_template='', logging_handlers=No
             operation_toolbelt = context.toolbelt(ctx)
             func_kwargs.setdefault('toolbelt', operation_toolbelt)
         validate_function_arguments(func, ctx=ctx, **func_kwargs)
-        with ctx.model.instrument(models.Node.attributes,
-                                  models.Node.properties,
-                                  models.NodeTemplate.attributes,
-                                  models.NodeTemplate.properties):
+        with ctx.model.instrument(ctx.INSTRUMENTATION_FIELDS):
             return func(ctx=ctx, **func_kwargs)
     return _wrapper
 

http://git-wip-us.apache.org/repos/asf/incubator-ariatosca/blob/80ae4c53/tests/orchestrator/workflows/executor/test_process_executor_extension.py
----------------------------------------------------------------------
diff --git a/tests/orchestrator/workflows/executor/test_process_executor_extension.py b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
index f3e40b6..48e272c 100644
--- a/tests/orchestrator/workflows/executor/test_process_executor_extension.py
+++ b/tests/orchestrator/workflows/executor/test_process_executor_extension.py
@@ -66,7 +66,7 @@ class MockProcessExecutorExtension(object):
     def decorate(self):
         def decorator(function):
             def wrapper(ctx, **operation_arguments):
-                with ctx.model.instrument({ctx.model.node.model_cls: ['attributes']}):
+                with ctx.model.instrument(ctx.model.node.model_cls.attributes):
                     ctx.node.attributes['out'] = {'wrapper_arguments': operation_arguments}
                     function(ctx=ctx, **operation_arguments)
             return wrapper