From 780cf2d7cad38112e8716816f5e602c7810489ba Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 28 Jun 2012 13:10:56 -0400 Subject: [PATCH] remove warning message to console on empty user-data Previously, if the user did not provide any user-data, then a warning would be emitted like: 2012-06-28 17:10:24,751 - __init__.py[WARNING]: Unhandled non-multipart userdata '' This just avoids the warning if there was no userdata. --- cloudinit/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cloudinit/__init__.py b/cloudinit/__init__.py index 6a1b46c5..dafb128a 100644 --- a/cloudinit/__init__.py +++ b/cloudinit/__init__.py @@ -607,7 +607,7 @@ def partwalker_callback(pdata, ctype, filename, payload): pdata['handlercount'] = 0 partwalker_handle_handler(pdata, ctype, filename, payload) return - if ctype not in pdata['handlers']: + if ctype not in pdata['handlers'] and payload: 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]