Yaml: Not able to use list_join in for_each construct

Bug #1466748 reported by Murali G D
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
lvdongbing
Kilo
Fix Released
Medium
Ethan Lynn

Bug Description

 Hi,

 Please see following YAML Template

    heat_template_version: 2015-04-30
    description: Distributed Appliance
    parameters:
      image:
        type: string
        description: Image used for servers
        default: 5d2ef44f-e2cb-4292-99cc-b282a0b5730f
      flavor:
        type: string
        description: flavor used by the servers
        default: DefaultFlavorTemplate
      user_data:
        type: string
        description: Server user_data
        default: HelloWorld
      mgmt_network:
        type: string
        description: Mgmt Network used by the server
        default: '67cbf03b-a8c9-4869-8a7c-ed0a52ee64a3'
      mgmt_fabric_network:
        type: string
        description: Fabric Mgmt Network used by the server
        default: '6f7f1f0e-dd98-4e24-aca3-824403feebdb'
      data_fabric_network:
        type: string
        description: Fabric Data Network used by the server
        default: '5d789666-7e58-40f4-bd35-885fc98f46f4'
      external_networks:
        type: string
        type: comma_delimited_list
        label: external networks
        default: 'fa0669c0-14b0-499a-bd53-735110ee40ca,3e393ce9-1526-4a1e-a654-efbd2779f438'

    resources:
      server:
        type: OS::Nova::Server
        properties:
          flavor: {get_param: flavor}
          image: {get_param: image}
          user_data: {get_param: user_data}
          user_data_format: RAW

          networks: #Option1
           - network: {get_param: mgmt_network}
           - network: {get_param: mgmt_fabric_network}
           - network: {get_param: data_fabric_network}
           repeat:
            for_each:
             extnetwork%: {get_param: external_networks}
            template:
             network: extnetwork%

          networks: #Option2
           repeat:
            for_each:
             extnetwork%: {get_param: mgmt_network} {get_param: mgmt_fabric_network} {get_param: data_fabric_network} {get_param: external_networks}
            template:
             network: extnetwork%

          networks: #Option3
           repeat:
            for_each:
             extnetwork%: {list_join: [',' , [{get_param: mgmt_network} , {get_param: mgmt_fabric_network} , {get_param: data_fabric_network} , {get_param: external_networks} ]]}
            template:
             network: extnetwork%

    outputs:
      server_ip:
        description: IP Address of the server.
        value: { get_attr: [server, first_address] }

Basically I want my Nova::Server to be connected to networks in order of - mgmt_network, mgmt_fabric_network, data_fabric_network and then a comma separated list of other external_networks as mentioned in parameters defaults. I am not able to achieve this. I have mentioned 3 options I tried under networks but none of them worked for me.

OpenStack Version: Kilo. HEAT 0.3.0.

Regards,
Murali G D

Changed in heat:
status: New → Triaged
importance: Undecided → Medium
lvdongbing (dbcocle)
Changed in heat:
assignee: nobody → lvdongbing (dbcocle)
Changed in heat:
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit a7c4b2332f9d1accaa89b51fbc3b09014995983a
Author: lvdongbing <email address hidden>
Date: Mon Jun 29 15:23:43 2015 +0800

    Should execute 'resolve' before check the values of 'for_each'

    Change-Id: I75f58885a91d11e52ed3737a806b5920774d586c
    Closes-Bug: #1466748

Changed in heat:
status: In Progress → Fix Committed
tags: added: kilo-backport-potential
removed: heat
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Angus Salkeld (asalkeld)
tags: removed: kilo-backport-potential
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-2 → 5.0.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/259863

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/kilo)

Reviewed: https://review.openstack.org/259863
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=629caa8bbf256786966e52e0c3382fa2c032737f
Submitter: Jenkins
Branch: stable/kilo

commit 629caa8bbf256786966e52e0c3382fa2c032737f
Author: lvdongbing <email address hidden>
Date: Mon Jun 29 15:23:43 2015 +0800

    Should execute 'resolve' before check the values of 'for_each'

    Change-Id: I75f58885a91d11e52ed3737a806b5920774d586c
    Closes-Bug: #1466748
    (cherry picked from commit a7c4b2332f9d1accaa89b51fbc3b09014995983a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/288794

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (master)

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

commit bf60398c906b3140553976513e9f08ecc44433c8
Author: Zane Bitter <email address hidden>
Date: Fri Mar 4 18:30:28 2016 -0500

    Resolve arguments to 'repeat' function at runtime

    This fixes a regression caused by a7c4b2332f9d1accaa89b51fbc3b09014995983a
    in evaluating the 'for_each' argument too early (at parse time - before the
    result of runtime functions like get_attr are available), while preserving
    the fix for bug 1466748 in allowing intrinsic functions to be used in the
    argument.

    Change-Id: If1e9c754ef372de2f7edd32a9a8247eb271c5871
    Closes-Bug: #1553306
    Related-Bug: #1466748

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (stable/liberty)

Related fix proposed to branch: stable/liberty
Review: https://review.openstack.org/291324

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to heat (stable/kilo)

Related fix proposed to branch: stable/kilo
Review: https://review.openstack.org/291343

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to heat (stable/liberty)

Reviewed: https://review.openstack.org/291324
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=4d13d27eca036a34ae6acd62b1e39a82cdaebb21
Submitter: Jenkins
Branch: stable/liberty

commit 4d13d27eca036a34ae6acd62b1e39a82cdaebb21
Author: Zane Bitter <email address hidden>
Date: Fri Mar 4 18:30:28 2016 -0500

    Resolve arguments to 'repeat' function at runtime

    This fixes a regression caused by a7c4b2332f9d1accaa89b51fbc3b09014995983a
    in evaluating the 'for_each' argument too early (at parse time - before the
    result of runtime functions like get_attr are available), while preserving
    the fix for bug 1466748 in allowing intrinsic functions to be used in the
    argument.

    Change-Id: If1e9c754ef372de2f7edd32a9a8247eb271c5871
    Closes-Bug: #1553306
    Related-Bug: #1466748
    (cherry picked from commit bf60398c906b3140553976513e9f08ecc44433c8)

tags: added: in-stable-liberty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (stable/kilo)

Change abandoned by Dave Walker (<email address hidden>) on branch: stable/kilo
Review: https://review.openstack.org/291343
Reason:
stable/kilo closed for 2015.1.4

This release is now pending its final release and no freeze exception has
been seen for this changeset. Therefore, I am now abandoning this change.

If this is not correct, please urgently raise a thread on openstack-dev.

More details at: https://wiki.openstack.org/wiki/StableBranch

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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