Incorrect inputs and outputs processing

Bug #1593975 reported by Denis Makogon
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
TOSCA Parser
In Progress
Undecided
SREELAKSHMI PENTA

Bug Description

Assume that there's a node with property 'auth_url' and attribute 'auth_token', then it is necessary to put them into 'outputs' section of a template:

  outputs:
    auth_token:
      value: { get_attribute: [ authorization_form, auth_token ] }
    auth_token:
      value: { get_property: [ authorization_form, auth_url ] }

But user did a mistake - he used the same name for both output items.

TOSCA parser parses in a wrong way. For item 'auth_token' it creates Output object with string value equal to '{ get_property: [ authorization_form, auth_url ] }'

This problem can be quickly overtaken by fixing output item names, and parser resolves everything correctly.

So, there are two possible ways to resolve this issue:
 - abort on parsing saying output overriding is not allowed.
 - create two Output objects with correct TOSCA functions resolving and let user deal with it.

description: updated
Changed in tosca-parser:
assignee: nobody → Santhosh64 (santhoshkumar-kondapalli)
Changed in tosca-parser:
assignee: Santhosh64 (santhoshkumar-kondapalli) → nobody
assignee: nobody → Santhosh64 (santhoshkumar-kondapalli)
Changed in tosca-parser:
assignee: Santhosh64 (santhoshkumar-kondapalli) → nobody
Changed in tosca-parser:
assignee: nobody → SREELAKSHMI PENTA (sreelakshmi-penta)
Changed in tosca-parser:
status: New → In Progress
Revision history for this message
Sahdev Zala (spzala) wrote :

Hi Denis, so did you see "value: { get_property: [ authorization_form, auth_url ] }" (i.e. the second value) as an output? I would vote for one of these:
1. Display the last output value? i.e. in this case, display:
    auth_token:
      value: { get_property: [ authorization_form, auth_url ] }
This is how 'OpenStack Heat' is working, that it respects last duplicated name and a similar approach should be fine for us.
2. Throw validation error that 'duplicate names are not allowed.

Revision history for this message
Denis Makogon (lildee1991) wrote : Re: [Bug 1593975] Re: Incorrect outputs processing

Hello.

I'm fine with validation error on duplication.

Kind regards,
Denys Makogon

2016-09-12 13:05 GMT+03:00 Sahdev Zala <email address hidden>:

> Hi Denis, so did you see "value: { get_property: [ authorization_form,
> auth_url ] }" (i.e. the second value) as an output? I would vote for one of
> these:
> 1. Display the last output value? i.e. in this case, display:
> auth_token:
> value: { get_property: [ authorization_form, auth_url ] }
> This is how 'OpenStack Heat' is working, that it respects last duplicated
> name and a similar approach should be fine for us.
> 2. Throw validation error that 'duplicate names are not allowed.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1593975
>
> Title:
> Incorrect outputs processing
>
> Status in TOSCA Parser:
> In Progress
>
> Bug description:
> Assume that there's a node with property 'auth_url' and attribute
> 'auth_token', then it is necessary to put them into 'outputs' section
> of a template:
>
> outputs:
> auth_token:
> value: { get_attribute: [ authorization_form, auth_token ] }
> auth_token:
> value: { get_property: [ authorization_form, auth_url ] }
>
> But user did a mistake - he used the same name for both output items.
>
> TOSCA parser parses in a wrong way. For item 'auth_token' it creates
> Output object with string value equal to '{ get_property: [
> authorization_form, auth_url ] }'
>
> This problem can be quickly overtaken by fixing output item names, and
> parser resolves everything correctly.
>
> So, there are two possible ways to resolve this issue:
> - abort on parsing saying output overriding is not allowed.
> - create two Output objects with correct TOSCA functions resolving and
> let user deal with it.
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/tosca-parser/+bug/1593975/+subscriptions
>

Revision history for this message
Miguel Caballer (micafer1) wrote : Re: Incorrect outputs processing

Hi All,

As an user I prefer to throw validation error that 'duplicate names are not allowed. It helps to avoid errors where you do not get the expected results.

So the inputs face a similar problem, it should also throw the same validation error.

Revision history for this message
Sahdev Zala (spzala) wrote :

Thanks Denis and Miguel. I have changed bug subject to fail validation for duplicate inputs and outputs.

summary: - Incorrect outputs processing
+ Incorrect inputs and outputs processing
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.