Comment 9 for bug 1434187

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

Reviewed: https://review.openstack.org/168328
Committed: https://git.openstack.org/cgit/openstack/heat-templates/commit/?id=f00cf8fbb89e04851d9cb0c5f2f99c80beb7d5c3
Submitter: Jenkins
Branch: master

commit f00cf8fbb89e04851d9cb0c5f2f99c80beb7d5c3
Author: Jiri Stransky <email address hidden>
Date: Fri Mar 27 13:31:10 2015 +0100

    Fix hiera deployment JSON generation

    We were hitting strange intermittent errors in TripleO where the hiera
    JSON file generated by Heat was not even valid JSON, ending with bits of
    text which seem out of place, and of varying length, e.g.

    "CREATE"}"}

    or

    "CREATE"}EATE"}

    The cause could be that the generation of the file runs multiple times,
    and if the first generated JSON is longer than the subsequent one, the
    ending of the previous JSON is still present in the file, because the
    generation opens the file with O_CREAT (create if not exists) and
    O_WRONLY (write only) flags, but not with O_TRUNC (truncate file before
    writing). This patch adds the truncation to fix the issue.

    Change-Id: Icf184f973decec2eb7de1dee9959b60774d83eb6
    Closes-Bug: #1434187