The translation of server's IP as output is error

Bug #1621923 reported by xiaodong shang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Translator
In Progress
Undecided
Ukesh

Bug Description

1.In the template version of 2013-05-23, the intrinsic function of get_attr doesn't support keys or indexes, it requires 2014-10-16 or higher, the syntax is below:
  get_attr:
    <resource name>
    <attribute name>
    <key/index 1> (optional) not support in 2013-05-23
    <key/index 2> (optional) not support in 2013-05-23
  The translation about compute node's ip address only uses two parameters currently.

2.So the translation result doesn't work presently, here is a simple example.
  Tosca definition is below.
    tosca_definitions_version: tosca_simple_yaml_1_0
    node_templates:
      server:
        type: tosca.nodes.Compute
        # omitted here for brevity
      outputs:
        server_ip:
          ip: { get_attribute: [server, private_address] }
  The translation result:
     heat_template_version: 2013-05-23
     resources:
       server:
         type: OS::Nova::Server
         # omitted here for brevity
     outputs:
       website_url:
         ip:
           get_attr:
             - server
             - networks
             - private
             - 0
  When deploy the result with hot, the output is None.

3.There are two solutions, one is modify the output as below:
    ip:
      get_attr:
        - server
        - networks
   or below:
    ip:
      get_attr:
        - server
        - addresses
  And the other is upgrade the version of Hot to 2014-10-16 or higher.

  I recommend the second.

Ukesh (ukeshkumar)
Changed in heat-translator:
assignee: nobody → Ukesh (ukeshkumar)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat-translator (master)

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

Changed in heat-translator:
status: New → In Progress
Revision history for this message
Sahdev Zala (spzala) wrote :

Hi Ukresh, thanks for the bug report and proposed fixes. I just got back from travel and looking at it now. At one point when first_address attribute was deprecated we moved to using the networks attribute and apparently the output verification was missed. I am good with second approach too, which I doubt not breaking anything else. I am hopping you might have already thought and verified it?
We need to find a better approach to go with HOT version changes and sometime back I had open this blueprint, https://blueprints.launchpad.net/heat-translator/+spec/translate-to-hot-latest-version

Revision history for this message
xiaodong shang (shangxdy) wrote :

The current solution is not complete correct, we will discuss it during weekly meeting.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat-translator (master)

Change abandoned by Ukesh Kumar (<email address hidden>) on branch: master
Review: https://review.openstack.org/370720

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.