Unusable traceback during heat resource_type_show

Bug #1394552 reported by Sergey Kraynev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Sergey Kraynev

Bug Description

If you have resource which references in environment file on not existing template you will get unrecognized error.
How to reproduce:
- delete or move file AWS_CloudWatch_Alarm.yaml from /etc/heat/templates/
- try to execute command:
heat resource-type-show AWS::CloudWatch::Alarm
or
heat resource-type-template AWS::CloudWatch::Alarm

you will get error:

ERROR: type object 'TemplateResource' has no attribute 'properties_schema'
Traceback (most recent call last):

  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
    incoming.message))

  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
    return self._do_dispatch(endpoint, method, ctxt, args)

  File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
    result = getattr(endpoint, method)(ctxt, **new_args)

  File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
    return f(*args, **kwargs)

  File "/opt/stack/heat/heat/engine/service.py", line 1004, in generate_template
    type_name).resource_to_template(type_name)

  File "/opt/stack/heat/heat/engine/resource.py", line 1082, in resource_to_template
    schema = cls.properties_schema

AttributeError: type object 'TemplateResource' has no attribute 'properties_schema'

I think we should wrap it in some understandable error message.

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/135924

Changed in heat:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

Reviewed: https://review.openstack.org/135924
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=51390e8ba70cc22202e27f972455af66d3dbe779
Submitter: Jenkins
Branch: master

commit 51390e8ba70cc22202e27f972455af66d3dbe779
Author: Sergey Kraynev <email address hidden>
Date: Mon Nov 24 08:04:12 2014 -0500

    Handle error with non existing template file

    This patch allows to propagate IOError instead of returning
    TemplateResource which does not contain property_schema.
    Change-Id: Ib1e09de8c10672312eea09f62a28f0885d98b089
    Closes-Bug: #1394552

Changed in heat:
status: In Progress → Fix Committed
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/140315

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

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

commit a2a41b585b5aebaeedac5dcc5604686b7eec4ce0
Author: Sergey Kraynev <email address hidden>
Date: Mon Nov 24 08:04:12 2014 -0500

    Handle error with non existing template file

    This patch allows to propagate IOError instead of returning
    TemplateResource which does not contain property_schema.
    It's the second attempt to adopt fix introduced here:
    Ib1e09de8c10672312eea09f62a28f0885d98b089.

    Change-Id: I45604648e3078f8ec6ba8b87a1c08eb6fca790ae
    Closes-Bug: #1394552

Thierry Carrez (ttx)
Changed in heat:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in heat:
milestone: kilo-1 → 2015.1.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.