ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mxmrlv <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #20: ARIA-9-API-for-operation-context
Date Tue, 15 Nov 2016 12:05:31 GMT
Github user mxmrlv commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/20#discussion_r87990005
  
    --- 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,
    --- End diff --
    
    inputs=None


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message