UniCodeError in Heat software config hooks in case of special characters

Bug #1382031 reported by Thomas Spatzier
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Templates
Fix Committed
Undecided
Thomas Spatzier

Bug Description

When working with Heat software config and the script hook, I got the following error when writing the 'config' script to a file:

UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 620: ordinal not in range(128)

The error is raised here:

https://github.com/openstack/heat-templates/blob/master/hot/software-config/elements/heat-config-script/install.d/hook-script.py#L58

Seems to be caused by a special character in the script.
I guess the same error also exists for the other software config hooks.

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

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

Changed in heat-templates:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-templates (master)

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

commit 7bbb87ec110208e88220ebf0b3d5df59ed7e9821
Author: Thomas Spatzier <email address hidden>
Date: Thu Oct 16 14:44:51 2014 +0200

    Use utf-8 encoding when writing config scripts

    Change from default encoding 'ascii' to 'utf-8' encoding when writing
    config scripts (stored in Heat software config's 'config' attribute).
    The default ascii encoding causes issues when config scripts include
    special characters.

    Change-Id: I6f9135ad646ec4996c1c012ff11f7929404ecc3e
    Closes-Bug: #1382031

Changed in heat-templates:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.