diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-04-25 14:03:16 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-04-25 14:03:16 -0400 |
commit | 4697c1afcc7d05951f4717a83dad01d2360301c6 (patch) | |
tree | 6d66840f102c71fb7dbd3eafc044cc5e75531d58 /cloudinit/util.py | |
parent | 8e97ca8cfaf75edc0b05b0dc2a2ef35c5c82221b (diff) | |
parent | a69c9c8a35b61f69f6e959448af8d0619989589f (diff) | |
download | vyos-cloud-init-4697c1afcc7d05951f4717a83dad01d2360301c6.tar.gz vyos-cloud-init-4697c1afcc7d05951f4717a83dad01d2360301c6.zip |
Fix issue in readurl with requests, support passing through headers_cb
This adds the 'headers_cb' option to pass all the way through to readurl.
It also makes requests for user-data not retry (as a 404 indicates "no
user-data").
LP: #1172742
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 50de55fe..053fa95d 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -671,7 +671,8 @@ def fetch_ssl_details(paths=None): def read_file_or_url(url, timeout=5, retries=10, - headers=None, data=None, sec_between=1, ssl_details=None): + headers=None, data=None, sec_between=1, ssl_details=None, + headers_cb=None): url = url.lstrip() if url.startswith("/"): url = "file://%s" % url @@ -685,6 +686,7 @@ def read_file_or_url(url, timeout=5, retries=10, timeout=timeout, retries=retries, headers=headers, + headers_cb=headers_cb, data=data, sec_between=sec_between, ssl_details=ssl_details) |