[ 
https://issues.apache.org/jira/browse/ARIA-105?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15932927#comment-15932927
 ] 

ASF GitHub Bot commented on ARIA-105:
-------------------------------------

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

    https://github.com/apache/incubator-ariatosca/pull/72#discussion_r106943057
  
    --- Diff: aria/orchestrator/workflows/api/task.py ---
    @@ -92,144 +93,133 @@ def __init__(self,
                                    if ignore_failure is None else 
ignore_failure)
             self.runs_on = runs_on
     
    -    @classmethod
    -    def _merge_inputs(cls, operation_inputs, additional_inputs=None):
    -        final_inputs = dict((p.name, p.as_raw['value']) for p in 
operation_inputs)
    -        final_inputs.update(additional_inputs or {})
    -        return final_inputs
    +        # Wrap inputs
    +        if inputs:
    +            for k, v in inputs.iteritems():
    +                if not isinstance(v, models.Parameter):
    +                    inputs[k] = models.Parameter.wrap(k, v)
    +
    +        # TODO: These extra inputs should likely be stored as a separate 
entry in the task model,
    +        # because they are different from the operation inputs. The two 
kinds of inputs should also
    +        # not be merged.
    +
    +        if interface_name or operation_name:
    +            operation = OperationTask._get_operation(actor.interfaces, 
interface_name,
    +                                                     operation_name)
    +            if operation is None:
    +                raise exceptions.TaskException(
    +                    'Could not find operation "{0}" on interface "{1}" for 
{2} "{3}"'
    +                    .format(operation_name, interface_name, actor_type, 
actor.name))
    +
    +            self.plugin = None
    +            if operation.plugin_specification:
    +                self.plugin = 
OperationTask._find_plugin(operation.plugin_specification)
    +                if self.plugin is None:
    +                    raise exceptions.TaskException(
    +                        'Could not find plugin of operation "{0}" on 
interface "{1}" for {2} "{3}"'
    +                        .format(operation_name, interface_name, 
actor_type, actor.name))
    +
    +            self.implementation = operation.implementation
    +            self.inputs = OperationTask._merge_inputs(operation.inputs, 
inputs)
    +
    +            self.name = OperationTask.NAME_FORMAT.format(type=actor_type,
    +                                                         name=actor.name,
    +                                                         
interface=interface_name,
    +                                                         
operation=operation_name)
    +        else:
    --- End diff --
    
    We have quite a few tests that instantiate `OperationTask` "from scratch" 
using raw arguments, instead of calling `for_node` and `for_relationship`. In 
order to support those I needed to allow for this separate codepath.


> Integrate new models into parser
> --------------------------------
>
>                 Key: ARIA-105
>                 URL: https://issues.apache.org/jira/browse/ARIA-105
>             Project: AriaTosca
>          Issue Type: Task
>            Reporter: Ran Ziv
>            Assignee: Tal Liron
>




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to