summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2011-12-22 03:40:52 -0500
committerScott Moser <smoser@ubuntu.com>2011-12-22 03:40:52 -0500
commit585284eca9e9219c6517eebc02d45edc800cf72d (patch)
tree7088ee53f4e068fd2dfdc113c3504a73bd6d7a0d
parent3b3b91960225d6525b8db9cc2789da0a62be2e14 (diff)
downloadvyos-cloud-init-585284eca9e9219c6517eebc02d45edc800cf72d.tar.gz
vyos-cloud-init-585284eca9e9219c6517eebc02d45edc800cf72d.zip
fix issue with multiple content-types
-rw-r--r--cloudinit/UserDataHandler.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/cloudinit/UserDataHandler.py b/cloudinit/UserDataHandler.py
index 84ad9c9b..541ee87a 100644
--- a/cloudinit/UserDataHandler.py
+++ b/cloudinit/UserDataHandler.py
@@ -183,7 +183,11 @@ def process_includes(msg, appendmsg=None):
explode_cc_archive(payload, appendmsg)
continue
- part['Content-Type'] = ctype
+ if 'Content-Type' in msg:
+ msg.replace_header('Content-Type', ctype)
+ else:
+ msg['Content-Type'] = ctype
+
_attach_part(appendmsg, part)
def message_from_string(data, headers={}):