From c307c3507ac94b591fc1ac9a81e5eaaa6d42a4b1 Mon Sep 17 00:00:00 2001 From: Joshua Harlow Date: Fri, 31 Aug 2012 18:12:30 -0700 Subject: [PATCH] When a parts content type is found to be different than its original content type said it is, make sure we set the new value, also unsure if the old top level message should have the same header (which will flip-flop). --- cloudinit/user_data.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py index f9f84030..803ffc3a 100644 --- a/cloudinit/user_data.py +++ b/cloudinit/user_data.py @@ -84,6 +84,12 @@ class UserDataProcessor(object): if ctype is None: ctype = ctype_orig + if ctype != ctype_orig: + if CONTENT_TYPE in part: + part.replace_header(CONTENT_TYPE, ctype) + else: + part[CONTENT_TYPE] = ctype + if ctype in INCLUDE_TYPES: self._do_include(payload, append_msg) continue @@ -92,6 +98,8 @@ class UserDataProcessor(object): self._explode_archive(payload, append_msg) continue + # Should this be happening, shouldn't + # the part header be modified and not the base? if CONTENT_TYPE in base_msg: base_msg.replace_header(CONTENT_TYPE, ctype) else: