diff options
author | Daniel Watkins <daniel.watkins@canonical.com> | 2015-03-04 17:20:48 +0000 |
---|---|---|
committer | Daniel Watkins <daniel.watkins@canonical.com> | 2015-03-04 17:20:48 +0000 |
commit | 5eb2aab5d010e7b8d5e4146959e50f2a9f67d504 (patch) | |
tree | 334f64c4eaadce28ffb0be60eb12fbfbdfdc46dc /cloudinit/user_data.py | |
parent | 014468ea3fb36e81a3e5a6fc593ce91571c1495f (diff) | |
download | vyos-cloud-init-5eb2aab5d010e7b8d5e4146959e50f2a9f67d504.tar.gz vyos-cloud-init-5eb2aab5d010e7b8d5e4146959e50f2a9f67d504.zip |
Add util.message_from_string to wrap email.message_from_string.
This is to work-around the fact that email.message_from_string uses
cStringIO in Python 2.6, which can't handle Unicode.
Diffstat (limited to 'cloudinit/user_data.py')
-rw-r--r-- | cloudinit/user_data.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py index 663a9048..eb3c7336 100644 --- a/cloudinit/user_data.py +++ b/cloudinit/user_data.py @@ -22,8 +22,6 @@ import os -import email - from email.mime.base import MIMEBase from email.mime.multipart import MIMEMultipart from email.mime.nonmultipart import MIMENonMultipart @@ -338,7 +336,7 @@ def convert_string(raw_data, headers=None): headers = {} data = util.decode_binary(util.decomp_gzip(raw_data)) if "mime-version:" in data[0:4096].lower(): - msg = email.message_from_string(data) + msg = util.message_from_string(data) for (key, val) in headers.items(): _replace_header(msg, key, val) else: |