Invalid deletion policy not correctly validated

Bug #1496502 reported by Steven Hardy
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Steven Hardy

Bug Description

$ heat stack-create del1 -f del_pol.yaml
ERROR:

-bash-4.3$ cat del_pol.yaml
heat_template_version: 2013-05-23
resources:
  test:
    type: OS::Heat::RandomString
    deletion_policy: wibble

This is because we're failing to catch an AssertionError in the engine when creating the ResourceDefinition in stack.Stack.validate (we catch it, but in the wrong place).

Steven Hardy (shardy)
Changed in heat:
assignee: nobody → Steven Hardy (shardy)
Steven Hardy (shardy)
Changed in heat:
assignee: Steven Hardy (shardy) → nobody
Revision history for this message
Zane Bitter (zaneb) wrote :

We should explicitly convert the policy values that are valid in the template to the values that are valid in the ResourceDefinition API, instead of relying on programming-by-coincidence for them to be the same. We should never ever ever catch an AssertionError.

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

Changed in heat:
assignee: nobody → Steven Hardy (shardy)
status: New → In Progress
Changed in heat:
importance: Undecided → Medium
Changed in heat:
milestone: none → liberty-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit 92bf3aa5dcf04d6d653174d3497de00a8b5c518b
Author: Steven Hardy <email address hidden>
Date: Wed Sep 16 21:38:47 2015 +0100

    Validate deletion policy during template parsing

    Currently we pass the template value directly into ResourceDefinition
    which can result in an assertion error from the constructor in the
    stack.Stack.validate path. We can avoid this by explicitly translating
    the expected policies for each template dialect into the keys
    supported by the resource definition.

    Change-Id: I54de89ec6b7cd4af722c9c263577252c15aaad64
    Closes-Bug: #1496502

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