summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/UserDataHandler.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/cloudinit/UserDataHandler.py b/cloudinit/UserDataHandler.py
index 5c95173a..ab7d0bc8 100644
--- a/cloudinit/UserDataHandler.py
+++ b/cloudinit/UserDataHandler.py
@@ -65,13 +65,15 @@ def process_includes(msg,parts):
payload = part.get_payload()
ctype = None
- for str, gtype in starts_with_mappings.items():
- if payload.startswith(str):
- ctype = gtype
- break
+ ctype_orig = part.get_content_type()
+ if ctype_orig == "text/plain":
+ for str, gtype in starts_with_mappings.items():
+ if payload.startswith(str):
+ ctype = gtype
+ break
if ctype is None:
- ctype = part.get_content_type()
+ ctype = ctype_orig
if ctype == 'text/x-include-url':
do_include(payload,parts)