summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-05-14 17:06:39 -0400
committerScott Moser <smoser@ubuntu.com>2015-05-14 17:06:39 -0400
commit74023961b70a178039ecf10f68745f6927113978 (patch)
treeab0f02962d1fcb87c5fae3af54ca645baa04bf45 /cloudinit
parent6d7ac1c317776b7266ffd8ffaa6610ca6918a7d0 (diff)
downloadvyos-cloud-init-74023961b70a178039ecf10f68745f6927113978.tar.gz
vyos-cloud-init-74023961b70a178039ecf10f68745f6927113978.zip
read_seeded: fix reed_seeded after regression
read_seeded was assuming a Response object back from load_tfile_or_url but load_tfile_or_url was returning string. since the only other user of this was a test, move load_tfile_or_url to a test, and just do the right thing in read_seeded. LP: #1455233
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/util.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py
index cae57770..db4e02b8 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -766,10 +766,6 @@ def fetch_ssl_details(paths=None):
return ssl_details
-def load_tfile_or_url(*args, **kwargs):
- return(decode_binary(read_file_or_url(*args, **kwargs).contents))
-
-
def read_file_or_url(url, timeout=5, retries=10,
headers=None, data=None, sec_between=1, ssl_details=None,
headers_cb=None, exception_cb=None):
@@ -837,10 +833,10 @@ def read_seeded(base="", ext="", timeout=5, retries=10, file_retries=0):
ud_url = "%s%s%s" % (base, "user-data", ext)
md_url = "%s%s%s" % (base, "meta-data", ext)
- md_resp = load_tfile_or_url(md_url, timeout, retries, file_retries)
+ md_resp = read_file_or_url(md_url, timeout, retries, file_retries)
md = None
if md_resp.ok():
- md = load_yaml(md_resp.contents, default={})
+ md = load_yaml(decode_binary(md_resp.contents), default={})
ud_resp = read_file_or_url(ud_url, timeout, retries, file_retries)
ud = None