get_resource fails in list

Bug #1248571 reported by Alexander Chudnovets
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Alexander Chudnovets
Havana
Fix Released
Medium
Thomas Herve

Bug Description

It seems that calling functions like a get_resource in lists in HOT template does not work.

When I use template like this:
  mylb:
    type: OS::Neutron::LoadBalancer
    dependson: server2
    properties:
      pool_id: { get_resource: pool }
      protocol_port: 80
      members: [c420bb4c-c748-47b1-a068-505683341ba5, 4d366207-f6de-41cf-b0d0-7b1f1a371a0b]

It works perfectly, but when I use something like this:

  server1:
    type: OS::Nova::Server
    properties:
      name: server1
      image: { get_param: image }
      flavor: { get_param: flavor }
      key_name: { get_param: key_name }
      networks:
        - port: { get_resource: server1_port }

  mylb:
    type: OS::Neutron::LoadBalancer
    dependson: server2
    properties:
      pool_id: { get_resource: pool }
      protocol_port: 80
      members: [ {get_resource: server1} ]

or

  mylb:
    type: OS::Neutron::LoadBalancer
    dependson: server2
    properties:
      pool_id: { get_resource: pool }
      protocol_port: 80
      members:
      - { get_resource: server1 }

it does not work with the same error:

WARNING heat.engine.resources.nova_utils [-] Instance ({u'get_resource': u'server1'}) not found: Instance could not be found

And this leads to neutronclient error:

TRACE heat.engine.resource NeutronClientException: Invalid input for address. Reason: 'None' is not a valid IP address.

It seems that HOT template parser does not handle function calls in lists.

Revision history for this message
JunJie Nan (nanjj) wrote :

Have you tried `Ref' in this scenario?

Changed in heat:
status: New → Triaged
milestone: none → icehouse-1
importance: Undecided → Medium
Revision history for this message
Alexander Chudnovets (achudnovets) wrote :

Seems that this is the same bug as https://bugs.launchpad.net/heat/+bug/1247638.

Changed in heat:
assignee: nobody → Alexander Chudnovets (achudnovets)
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/55816
Committed: http://github.com/openstack/heat/commit/700d766a6f5a06a720f33c4b69da4d49dd04264d
Submitter: Jenkins
Branch: master

commit 700d766a6f5a06a720f33c4b69da4d49dd04264d
Author: Alexander Chudnovets <email address hidden>
Date: Mon Nov 11 12:13:45 2013 +0200

    Fix "members" property check

    According to https://bugs.launchpad.net/heat/+bug/1247638/comments/3

    Closes-Bug: #1248571
    Closes-Bug: #1247638
    Change-Id: I4a61963d730250d8c3714b20c9cc7bb3717d85af

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/havana)

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/75126

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/havana
Review: https://review.openstack.org/75336

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

Reviewed: https://review.openstack.org/75336
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=a440ccb5c74be3d92ca1aeb7507239f341b3633f
Submitter: Jenkins
Branch: stable/havana

commit a440ccb5c74be3d92ca1aeb7507239f341b3633f
Author: Alexander Chudnovets <email address hidden>
Date: Mon Nov 11 12:13:45 2013 +0200

    Fix "members" property check

    According to https://bugs.launchpad.net/heat/+bug/1247638/comments/3

    Closes-Bug: #1248571
    Closes-Bug: #1247638
    Change-Id: I4a61963d730250d8c3714b20c9cc7bb3717d85af

Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-1 → 2014.1
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.