HOT template validation hides error messages

Bug #1298444 reported by Thomas Herve
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
huangtianhua

Bug Description

A simple example: try to use "Metadata" in a HOT template. You can a message "At least one Resources member must be defined." but the real error is '"Metadata" is not a valid keyword inside a resource definition'. We shouldn't build an error and instead return the error returned by the KeyError happening when getting the 'Resources' key.

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
Changed in heat:
assignee: huangtianhua (huangtianhua) → nobody
Revision history for this message
huangtianhua (huangtianhua) wrote :

Do you mind if I modify this?

Changed in heat:
assignee: nobody → huangtianhua (huangtianhua)
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/83677

Changed in heat:
status: New → In Progress
Revision history for this message
Liang Chen (cbjchen) wrote :

This might have being fixed somewhere. Below is what I got when using Metadata in hot template without this patch.

ERROR: u'u\'"Metadata" is not a valid keyword inside a resource definition\'\nTraceback (most recent call last):\n\n File "/home/cl/openstack/community/heat/heat/openstack/common/rpc/amqp.py", line 462, in _process_data\n **args)\n\n File "/home/cl/openstack/community/heat/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n\n File "/home/cl/openstack/community/heat/heat/engine/service.py", line 63, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File "/home/cl/openstack/community/heat/heat/engine/service.py", line 510, in create_stack\n self._validate_new_stack(cnxt, stack_name, tmpl)\n\n File "/home/cl/openstack/community/heat/heat/engine/service.py", line 443, in _validate_new_stack\n num_resources = len(parsed_template[parsed_template.RESOURCES])\n\n File "/home/cl/openstack/community/heat/heat/engine/hot/template.py", line 74, in __getitem__\n return self._translate_resources(the_section)\n\n File "/home/cl/openstack/community/heat/heat/engine/hot/template.py", line 107, in _translate_resources\n _(\'"%s" is not a valid keyword \'\n\n File "/home/cl/openstack/community/heat/heat/engine/hot/template.py", line 87, in _translate\n raise KeyError(err_msg % value)\n\nKeyError: u\'"Metadata" is not a valid keyword inside a resource definition\'\n'

Revision history for this message
Thomas Herve (therve) wrote :

Liang: the problem is with heat validate-template, not heat stack-create.

Revision history for this message
Liang Chen (cbjchen) wrote :

Oops, Never mind.

Changed in heat:
milestone: none → juno-1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit 0d20a644b22b1c2113d7fe43a3c66d1a5a328f57
Author: huangtianhua <email address hidden>
Date: Fri Mar 28 14:54:29 2014 +0800

    Fix incorrect error msg in validate_template()

    The error message "At least one Resources member must be defined." raised
    while checking the "resources" definition which has not supported in hot
    template.

    Change-Id: I69808bdd890929e00c9c74aa956c2def6dd256af
    Closes-Bug: #1298444

Changed in heat:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in heat:
milestone: juno-1 → icehouse-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: icehouse-rc1 → 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.