JSON/YAML conversion ignores inline keys

Bug #1467029 reported by Kent Wang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Low
Kent Wang

Bug Description

I noticed this while working on a related bug: https://bugs.launchpad.net/heat/+bug/1286380

In a previous patch https://review.openstack.org/#/c/102229/
the assignee said:

"""
I went through the template which you have mentioned and the template that i am using. The difference in both is that the template which i am using has the value in next line
"F17": {
 "32": "F17-i386-cfntools",
 "64": "F17-x86_64-cfntools"
},
and the template that you have mentioned has the values in same line i.e.
"F17": { "32" : "F17-i386-cfntools", "64" : "F17-x86_64-cfntools" }

"""

After digging around with the errors, it looks like the parser in heat.common.template_format.py is ignoring the inline keys. It treats the whole line ({ "32" : "F17-i386-cfntools", "64" : "F17-x86_64-cfntools" }) as the value of the key (F17), without recursively looking at the inline keys.

To check this, I debugged the convert_json_to_yaml method and looks like the '__order__' substring was never appended to the inline keys.

When the template is in the form of:
"F17": {
 "32": "F17-i386-cfntools",
 "64": "F17-x86_64-cfntools"
},
the keys get parsed correctly

Kent Wang (k.wang)
Changed in heat:
assignee: nobody → Kent Wang (k.wang)
Changed in heat:
status: New → Triaged
importance: Undecided → Low
Revision history for this message
Kent Wang (k.wang) wrote :
Changed in heat:
status: Triaged → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: none → liberty-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: liberty-2 → 5.0.0
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.