heat validation improvements and error verbosity

Bug #1294295 reported by Steve Lipinski
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Jay Dobies

Bug Description

When validating a template, very terse errors are usually provided.

Specifically, the case I encountered - where a parameter was defined yet the type attribute was accidentally omitted, e.g.,
  internal_network_type:
    label: Internal Network Type
    description: The type of internal network to be used

The error in the engine-api.log:
2014-03-18 13:47:08.303 46002 ERROR root [-] Unexpected error occurred serving API: u'\'Type\'\nTraceback (most recent call last):\n\n File "/usr/lib/python2.6/site-packages/heat/openstack/common/rpc/amqp.py", line 461, in _process_data\n **args)\n\n File "/usr/lib/python2.6/site-packages/heat/openstack/common/rpc/dispatcher.py", line 172, in dispatch\n result = getattr(proxyobj, method)(ctxt, **kwargs)\n\n File "/usr/lib/python2.6/site-packages/heat/engine/service.py", line 60, in wrapped\n return func(self, ctx, *args, **kwargs)\n\n File "/usr/lib/python2.6/site-packages/heat/engine/service.py", line 383, in validate_template\n tmpl_params = parser.Parameters(None, tmpl, validate_value=False)\n\n File "/usr/lib/python2.6/site-packages/heat/engine/parameters.py", line 360, in __init__\n self.params = dict((p.name, p) for p in parameters())\n\n File "/usr/lib/python2.6/site-packages/heat/engine/parameters.py", line 360, in <genexpr>\n self.params = dict((p.name, p) for p in parameters())\n\n File "/usr/lib/python2.6/site-packages/heat/engine/parameters.py", line 355, in parameters\n yield Parameter(name, schema, value, validate_value)\n\n File "/usr/lib/python2.6/site-packages/heat/engine/parameters.py", line 144, in __new__\n param_type = schema[TYPE]\n\nKeyError: \'Type\'\n'

The heat client output:
ERROR: Type

It would be nice if the validator would indicate the problematic parameter, e.g.,
ERROR parameter 'internal_network_type' missing required attribute 'type'

Changed in heat:
status: New → Triaged
importance: Undecided → Medium
Jay Dobies (jdob)
Changed in heat:
assignee: nobody → Jay Dobies (jdob)
Jay Dobies (jdob)
Changed in heat:
status: Triaged → In Progress
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/86420

Steven Hardy (shardy)
tags: added: icehouse-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit 4c582a2bc074009d2c7f5ae189c989c0b686cd04
Author: Jay Dobies <email address hidden>
Date: Wed Apr 9 14:55:24 2014 -0400

    More specific exceptions when validating params

    In addition to the example cited in the bug, this updates a few other
    exception messages to indicate the name of the parameter that is failing
    validation.

    Change-Id: I1b7729305988444dc15abd6e5d958f443efc091d
    Closes-Bug: #1294295

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