fuel-agent: unicode handling in cloud-init templates

Bug #1596974 reported by Alexander Gordeev
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Confirmed
Low
Fuel Sustaining

Bug Description

Apparently, fuel-agent uses `write-mime-multipart` [1] for aggregating multiple types of cloud-init user-data payloads into a signle one user-data file.

this tool doesn't have abitlity to specify non-default charset, thus it will be always producing 'us-ascii' plain text files. that wasn't an issue when all input data was limited to ASCII values (which is still purely compatible with UTF-8).

even if any of partial cloud-init payload contains non-ascii characters, it will use 'us-ascii' charset in the resulting multipart file due to [2]:

            # Note: we should handle calculating the charset
            msg = MIMEText(fp.read(), _subtype=subtype)

MIMEText supports specifying of the output charset [3]. However, `write-mime-multipart` isn't passing the charset at all.

[1] https://github.com/openstack/fuel-agent/blob/d40821e9a7b12a7ec6045c765c0e4b65f6df3239/fuel_agent/manager.py#L392-L396
[2] http://bazaar.launchpad.net/~cloud-utils-dev/cloud-utils/trunk/view/head:/bin/write-mime-multipart#L87
[3] https://docs.python.org/2/library/email.mime.html#email.mime.text.MIMEText

Ilya Kharin (akscram)
Changed in fuel:
assignee: nobody → Fuel Sustaining (fuel-sustaining-team)
status: New → Confirmed
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.