From fa5a94ea415fc04c0fc50e9d3c08399f43aabcef Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Wed, 25 Feb 2015 19:47:07 -0500 Subject: UserDataProcessor: during include, do not convert to string an include can include a gzip type also or binary data so avoid conversion here. --- cloudinit/user_data.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cloudinit/user_data.py') diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py index b11894ce..77f95abb 100644 --- a/cloudinit/user_data.py +++ b/cloudinit/user_data.py @@ -239,7 +239,7 @@ class UserDataProcessor(object): if include_once_on and resp.ok(): util.write_file(include_once_fn, resp, mode=0o600) if resp.ok(): - content = str(resp) + content = resp else: LOG.warn(("Fetching from %s resulted in" " a invalid http code of %s"), -- cgit v1.2.3 From d136a3cf9aa409a0275cc884227971c1cd21720d Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 26 Feb 2015 13:51:35 -0500 Subject: avoid conversion to string in #include --- cloudinit/user_data.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cloudinit/user_data.py') diff --git a/cloudinit/user_data.py b/cloudinit/user_data.py index 77f95abb..663a9048 100644 --- a/cloudinit/user_data.py +++ b/cloudinit/user_data.py @@ -237,9 +237,9 @@ class UserDataProcessor(object): resp = util.read_file_or_url(include_url, ssl_details=self.ssl_details) if include_once_on and resp.ok(): - util.write_file(include_once_fn, resp, mode=0o600) + util.write_file(include_once_fn, resp.contents, mode=0o600) if resp.ok(): - content = resp + content = resp.contents else: LOG.warn(("Fetching from %s resulted in" " a invalid http code of %s"), -- cgit v1.2.3