comma_delimited_list validated too eagerly, breaks with list_join

Bug #1617019 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
High
Rabi Mishra

Bug Description

It seems that either we're resolving list_join incorrectly, or perhaps there's an issue with validation and the comma_delimited_list type:

[stack@instack ~]$ heat stack-create foo3 -f list_join.yaml
ERROR: Property error: : resources.nested_3.properties.the_param: : "u''" is not a list

[stack@instack ~]$ cat list_join.yaml
heat_template_version: 2016-04-08

resources:
  nested:
    type: nested.yaml
  nested2:
    type: nested.yaml
  nested_3:
    type: nested2.yaml
    properties:
      # This evaluates to "n1,n2,n1,n2" in the output but
      # fails validation passing it to the nested stack
      the_param:
        list_join:
          - ','
          - {get_attr: [nested, service_names]}
          - {get_attr: [nested2, service_names]}
outputs:
  the_param:
    value:
      list_join:
        - ','
        - {get_attr: [nested, service_names]}
        - {get_attr: [nested2, service_names]}

[stack@instack ~]$ cat nested.yaml
heat_template_version: 2016-04-08

outputs:
  service_names:
    value:
      - n1
      - n2

[stack@instack ~]$ cat nested2.yaml
heat_template_version: 2016-04-08

parameters:
  the_param:
    type: comma_delimited_list

Tags: tripleo
Revision history for this message
Steven Hardy (shardy) wrote :

Hmm, so changing nested2 to use type:string seems to work, so it may just be that we're validating comma_delimited_list too eagerly?

summary: - list_join not resolved when passed to nested template
+ comma_delimited_list validated too eagerly, breaks with list_join
Revision history for this message
Steven Hardy (shardy) wrote :

Hmm, actually it appears this is unrelated to the list_join, hard-coding a comma delimited string breaks in a similar way:

[stack@instack ~]$ heat stack-create a1 -f list_join2.yaml
WARNING (shell) "heat stack-create" is deprecated, please use "openstack stack create" instead
ERROR: Property error: : resources.nested_3.properties.the_param: : "u'1,2,3'" is not a list
[stack@instack ~]$ cat list_join2.yaml
heat_template_version: 2016-04-08

resources:
  nested_3:
    type: nested2.yaml
    properties:
      the_param: "1,2,3"
[stack@instack ~]$ cat nested2.yaml
heat_template_version: 2016-04-08

parameters:
  the_param:
    type: comma_delimited_list

Changed in heat:
status: New → Triaged
importance: Undecided → High
tags: added: tripleo
Rabi Mishra (rabi)
Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (master)

Fix proposed to branch: master
Review: https://review.openstack.org/361121

Changed in heat:
status: Triaged → In Progress
Thomas Herve (therve)
Changed in heat:
milestone: none → newton-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/361121
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=80bc4fbebd02961decc4e58bbc149a8614c18b92
Submitter: Jenkins
Branch: master

commit 80bc4fbebd02961decc4e58bbc149a8614c18b92
Author: rabi <email address hidden>
Date: Fri Aug 26 17:05:54 2016 +0530

    Convert props form delimited params to lists

    Use allow_conversion flag to convert comma_delimited_list
    to list before validation when using from_parameter.

    Change-Id: Id144aade23eee13df227acdb728906c8dd345337
    Closes-Bug: #1617019

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 7.0.0.0b3

This issue was fixed in the openstack/heat 7.0.0.0b3 development milestone.

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.