summaryrefslogtreecommitdiff
path: root/cloudinit/UserDataHandler.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2012-03-12 14:56:35 -0400
committerScott Moser <smoser@ubuntu.com>2012-03-12 14:56:35 -0400
commiteefca80065bf9cae734022c0665aa8ffbf3ee81e (patch)
treec6e9416c6de0b07812e53093bc6fef9688809d11 /cloudinit/UserDataHandler.py
parent430f0fc7fb0b2472ced13785e3a6b5785e304e16 (diff)
parentc1a006bb9ee915c08075e9adeab245f02452ee43 (diff)
downloadvyos-cloud-init-eefca80065bf9cae734022c0665aa8ffbf3ee81e.tar.gz
vyos-cloud-init-eefca80065bf9cae734022c0665aa8ffbf3ee81e.zip
Warn in user-data processing on non-multipart, non-handled data
If user-data is supplied that is not multipart, and is unhandled, then log a warning. A warning by default will get to the console, so the user can see it even if they cannot get into the instance. If they don't see it there, it would still be available in the cloud-init log.
Diffstat (limited to 'cloudinit/UserDataHandler.py')
-rw-r--r--cloudinit/UserDataHandler.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/UserDataHandler.py b/cloudinit/UserDataHandler.py
index 98729056..ec914480 100644
--- a/cloudinit/UserDataHandler.py
+++ b/cloudinit/UserDataHandler.py
@@ -180,7 +180,7 @@ def process_includes(msg, appendmsg=None):
payload = part.get_payload(decode=True)
- if ctype_orig == "text/plain":
+ if ctype_orig in ("text/plain", "text/x-not-multipart"):
ctype = type_from_startswith(payload)
if ctype is None:
@@ -213,7 +213,7 @@ def message_from_string(data, headers=None):
else:
msg[key] = val
else:
- mtype = headers.get("Content-Type", "text/plain")
+ mtype = headers.get("Content-Type", "text/x-not-multipart")
maintype, subtype = mtype.split("/", 1)
msg = MIMEBase(maintype, subtype, *headers)
msg.set_payload(data)