Comment 1 for bug 1626256

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

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

commit 55c21c18e6455515c93f6f6222e7dd820c45ebd5
Author: Zane Bitter <email address hidden>
Date: Wed Sep 21 14:57:22 2016 -0400

    Don't delete RawTemplate if it referenced by a stack

    When creating a nested stack and pre-storing the raw template, we
    previously used a try/finally block to ensure that if the stack creation
    was never started (e.g. because the template failed validation at the other
    end) that we would delete the raw template again rather than leave it lying
    around in the DB. However, this catches too broad a range of exceptions. If
    an exception such as GreenletExit occurs inside this block, then we will
    attempt to delete the raw template, resulting in a DB IntegrityError either
    here (because the template id is already referenced by a stack) or when
    trying to store the stack (because the template is gone).

    Resolve this by only doing the cleanup on HeatExceptions, which indicates
    that the other engine has bailed out without storing the stack.

    Change-Id: Ie24a82b7ce16281c72d4eb66cca8683248628b46
    Closes-Bug: #1626256