HOT allows for inconsistent spelling in resources

Bug #1274288 reported by Thomas Spatzier
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Undecided
Thomas Spatzier

Bug Description

The way the HOTemplate class is currently implemented, it allows for inconsistent spelling of some keywords like 'type' or 'properties' inside resources. It allows both uppercase and lowercase first characters, where the HOT spec says that lowercase should be used.

This should be fixed so that users get validation errors in templates and we can enforce compliance to the documentation.

When this is fixed, a migration script has to be provided as well to update potentially "wrong" templates that are already in the database.

Changed in heat:
assignee: nobody → Thomas Spatzier (thomas-spatzier)
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/70049

Changed in heat:
assignee: Thomas Spatzier (thomas-spatzier) → andrew plunk (andrew-plunk)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Revision history for this message
Thomas Spatzier (thomas-spatzier) wrote :

I had originally opened this bug for another issue related to the resources section in a HOT template. I.e. the issue with the parameters type we discussed in the IRC meeting yesterday is one issue, the resources section is another issue I wanted to cover with this bug.

If everyone agrees, we can cover everything under this bug. I.e. I would provide a patch for hot.py to fix the resources issue, and provide another migrate script for that one.

Opinions?

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in heat:
assignee: andrew plunk (andrew-plunk) → Thomas Spatzier (thomas-spatzier)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit 010132f101d7796d0320ecd6d2ce9321e0550b67
Author: Andrew Plunk <email address hidden>
Date: Thu Feb 6 16:54:48 2014 -0600

    raw_template hot parameter type data migration

    Changes were made to the hot syntax which prevent invalid templates
    already present in the database from being loaded as part of a stack
    list. This database migration forces the parameter schema type to
    be lowercase.

    Change-Id: Iaa4b16e9b5188e6e99cda95e1c7fb0dc11c206f7
    Partial-Bug: #1274288

Revision history for this message
Thomas Spatzier (thomas-spatzier) wrote :

Patch has been submitted but some tempest test cases will fail until [1] is fixed, i.e. [2] is merged.

[1] https://bugs.launchpad.net/tempest/+bug/1288114
[2] https://review.openstack.org/#/c/78136/

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit 18bd01638849febfcaffa1da27591e52054c6a1d
Author: Thomas Spatzier <email address hidden>
Date: Mon Jan 27 19:43:59 2014 +0100

    Fix HOT inconsistencies in resource sections

    This patch fixes inconsistencies between keywords in resource
    definitions in a HOT template as documented in the HOT specification
    and the way they are processed by the code.

    So far it was possible to use CFN like syntax or HOT syntax inside
    resource definitions (e.g. both 'properties' and 'Properties' were
    accepted) since the HOT processing code did tolerant processing.
    Consequently, users had been able to produce CFN/HOT mixed templates.

    This patch introduces strict enforcement of allowed keywords to
    make HOT templates consistent with the spec by providing concrete
    validation errors in case of invalid keywords.

    This patch also adds a DB migration step to update existing templates
    in the Heat database with potentially legacy keywords to comply with
    the new strict syntax checking rules.

    Change-Id: I44309acda86a930030cb70493f409e3ea4740130
    Closes-Bug: #1274288
    Closes-Bug: #1271008

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