diff options
author | Martin Packman <martin.packman@canonical.com> | 2012-03-12 13:56:40 +0000 |
---|---|---|
committer | Martin Packman <martin.packman@canonical.com> | 2012-03-12 13:56:40 +0000 |
commit | c1a006bb9ee915c08075e9adeab245f02452ee43 (patch) | |
tree | 414ec6af086d9d39cebf4177ed14c10837d5b3c6 /cloudinit/__init__.py | |
parent | de316086b3915ddfc242a5cc25324f3181148a49 (diff) | |
download | vyos-cloud-init-c1a006bb9ee915c08075e9adeab245f02452ee43.tar.gz vyos-cloud-init-c1a006bb9ee915c08075e9adeab245f02452ee43.zip |
Restrict warning to userdata without MIME wrapping only while still ignoring most types
Diffstat (limited to 'cloudinit/__init__.py')
-rw-r--r-- | cloudinit/__init__.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 98a48fec..1c3f861c 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -606,12 +606,14 @@ def partwalker_callback(pdata, ctype, filename, payload): partwalker_handle_handler(pdata, ctype, filename, payload) return if ctype not in pdata['handlers']: - start = payload.split("\n", 1)[0][:24] # Use first line or 24 bytes - if start < payload: - details = "starting '%s...'" % start.encode("string-escape") - else: - details = repr(payload) - log.warning("Unhandled userdata part of type %s %s", ctype, details) + if ctype == "text/x-not-multipart": + # Extract the first line or 24 bytes for displaying in the log + start = payload.split("\n", 1)[0][:24] + if start < payload: + details = "starting '%s...'" % start.encode("string-escape") + else: + details = repr(payload) + log.warning("Unhandled non-multipart userdata %s", details) return handler_handle_part(pdata['handlers'][ctype], pdata['data'], ctype, filename, payload, pdata['frequency']) |