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

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

Github user ran-z commented on a diff in the pull request:

    https://github.com/apache/incubator-ariatosca/pull/138#discussion_r119444608
  
    --- Diff: extensions/aria_extension_tosca/simple_v1_0/modeling/__init__.py 
---
    @@ -384,18 +387,37 @@ def create_operation_template_model(context, 
service_template, operation):
                     model.relationship_edge = True
     
             dependencies = implementation.dependencies
    +        configuration = OrderedDict()
             if dependencies:
                 for dependency in dependencies:
                     key, value = split_prefix(dependency)
                     if key is not None:
    -                    if model.configuration is None:
    -                        model.configuration = {}
    -                    set_nested(model.configuration, key.split('.'), value)
    +                    # Parse as YAML
    +                    try:
    +                        value = yaml.load(value)
    +                    except yaml.parser.MarkedYAMLError as e:
    +                        context.validation.report(
    +                            'YAML parser {0} in operation configuration: 
{1}'
    +                            .format(e.problem, value),
    +                            locator=implementation._locator,
    +                            level=Issue.FIELD)
    +                        continue
    --- End diff --
    
    :+1: 


> Support instrinsic functions in "dependencies" operation configuration
> ----------------------------------------------------------------------
>
>                 Key: ARIA-149
>                 URL: https://issues.apache.org/jira/browse/ARIA-149
>             Project: AriaTosca
>          Issue Type: Story
>            Reporter: Tal Liron
>            Assignee: Tal Liron
>
> There are a few issues here. First, the following YAML is totally broken;
> {code}
>               dependencies:
>                 - ssh.address > { get_attribute: virtual_ip.floating_ip }
> {code}
> The problem is that in YAML, due to the location of the ":", this gets parsed 
> as a dict where the key is {code}ssh.address > { get_attribute{code} and the 
> value is {code}virtual_ip.floating_ip }{code} which is not what we want at 
> all.
> The solution is to encase the whole value in quotes to enforce parsing as a 
> string:
> {code}
>               dependencies:
>                 - "ssh.address > { get_attribute: virtual_ip.floating_ip }"
> {code}
> Note that the one attractive solution is to to change this ">" format to a 
> real dict. So:
> {code}
>               dependencies:
>                 - { ssh.address: { get_attribute: virtual_ip.floating_ip } }
> {code}
> But this will break other TOSCA parsers that expect a string here, so no go. 
> :(



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

Reply via email to