ariatosca-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tliron <...@git.apache.org>
Subject [GitHub] incubator-ariatosca pull request #95: ARIA-92 Automatic operation task confi...
Date Thu, 13 Apr 2017 17:29:03 GMT
Github user tliron commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/95#discussion_r111443310
  
    --- Diff: aria/orchestrator/workflows/api/task.py ---
    @@ -66,98 +66,84 @@ def __init__(self,
                      actor_type,
                      interface_name,
                      operation_name,
    -                 runs_on=None,
    +                 inputs=None,
                      max_attempts=None,
                      retry_interval=None,
    -                 ignore_failure=None,
    -                 inputs=None):
    +                 ignore_failure=None):
             """
             Do not call this constructor directly. Instead, use :meth:`for_node` or
             :meth:`for_relationship`.
             """
     
    -        assert isinstance(actor, (models.Node, models.Relationship))
    -        assert actor_type in ('node', 'relationship')
             assert interface_name and operation_name
    -        assert runs_on in models.Task.RUNS_ON
             super(OperationTask, self).__init__()
     
    +        operation = None
    +        interface = actor.interfaces.get(interface_name)
    +        if interface is not None:
    +            operation = interface.operations.get(operation_name)
    +
    +        if operation is None:
    +            raise exceptions.OperationNotFoundException(
    +                'Could not find operation "{0}" on interface "{1}" for {2} "{3}"'
    +                .format(operation_name, interface_name, actor_type, actor.name))
    +
    +        if operation.implementation is None:
    --- End diff --
    
    We agreed to keep this behavior for now.


---
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