Heat's implementation of Fn::Base64 is a pass-through, despite documentation to the contrary.

Bug #1377323 reported by Chris Howe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Qiming Teng

Bug Description

I need to pass some data from a stack parameter to my user data. The data in the stack parameter may or may not contain whitespaces or carriage returns. In any case, I want the data to show up without breaking the yaml formatting of my userdata. It is silly to require that the value of the parameter know what yaml context it is going to be interpolated in, so the solution to this problem for AWS cloudformation would be to use Fn::Base64 to encode the data before stuffing it into the userdata.

"UserData": { "Fn::Base64", {"Fn::Join", [ "", [
"#cloud-init\n",
"runcmd:\n",
" - |\n",
" echo ",{"Fn::Base64": {"Ref": "InputParameter"}}, "| base64 -d > /etc/myfile.conf\n"
" EOF\n"
]]}}

Now, I understand that openstack does not like base64 encoded userdata, so if need be, I am happy to eliminate the outer Base64. The inner base64 is more important.

At the very least, UPDATE THE DOCUMENTATION TO SHOW THAT FN::BASE64 IS A PASSTHROUGH!!!!!

Angus Salkeld (asalkeld)
Changed in heat:
status: New → Triaged
importance: Undecided → Medium
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/137747

Changed in heat:
assignee: nobody → Qiming Teng (tengqim)
status: Triaged → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (master)

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

commit e11ecb4f431eec1c9d0cc248743c28a253b6b541
Author: tengqm <email address hidden>
Date: Fri Nov 28 16:47:46 2014 +0800

    Fix documentation on Fn::Base64 function

    The documentation says that the 'Fn::Base64' function converts an
    input string into Base64, while the implementation is actually a
    pass-through. This patch fixes the documentation to avoid confusions
    caused to users.

    Change-Id: I643e73f7ed258da06d09f17a3302a258e3303414
    Closes-Bug: 1377323

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