Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/20#discussion_r87989491
  
    --- Diff: aria/workflows/api/task.py ---
    @@ -66,22 +69,83 @@ def __init__(self,
             Creates an operation task using the name, details, node instance 
and any additional kwargs.
             :param name: the operation of the name.
             :param operation_details: the details for the operation.
    -        :param node_instance: the node instance on which this operation is 
registered.
    +        :param actor: the operation host on which this operation is 
registered.
             :param inputs: operation inputs.
             """
    -        super(OperationTask, self).__init__()
    -        self.name = name
    -        self.operation_details = operation_details
    -        self.node_instance = node_instance
    +        assert isinstance(actor, (storage.models.NodeInstance,
    +                                  storage.models.RelationshipInstance))
    +        super(_OperationTask, self).__init__()
    +        self.actor = actor
    +        self.name = '{name}.{actor.id}'.format(name=name, actor=actor)
    +        self.operation_mapping = operation_mapping
             self.inputs = inputs or {}
    -        self.max_attempts = (self.workflow_context.task_max_attempts
    +        self.max_attempts = (self.workflow_context._task_max_attempts
                                  if max_attempts is None else max_attempts)
    -        self.retry_interval = (self.workflow_context.task_retry_interval
    +        self.retry_interval = (self.workflow_context._task_retry_interval
                                    if retry_interval is None else 
retry_interval)
    -        self.ignore_failure = (self.workflow_context.task_ignore_failure
    +        self.ignore_failure = (self.workflow_context._task_ignore_failure
                                    if ignore_failure is None else 
ignore_failure)
     
     
    +class NodeOperationTask(_OperationTask):
    +    """
    +    Represents a node based operation
    +    """
    +    def __init__(self,
    +                 actor,
    +                 name,
    +                 *args,
    +                 **kwargs):
    +        """
    +        Represents a relationship based operation
    +
    +        :param actor: the node of which this operation belongs to.
    +        :param name: the name of the operation.
    +        """
    +        assert isinstance(actor, storage.models.NodeInstance)
    +        assert 'operation_details' not in kwargs
    +        operation_mapping = actor.node.operations[name].get('operation', 
'')
    +        operation_inputs = actor.node.operations[name].get('inputs', {})
    +        operation_inputs.update(kwargs.pop('inputs', {}) or {})
    --- End diff --
    
    +        operation_inputs.update(kwargs.pop('inputs', {}))



---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to