summaryrefslogtreecommitdiff
path: root/cloudinit/util.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2013-04-25 11:58:38 -0400
committerScott Moser <smoser@ubuntu.com>2013-04-25 11:58:38 -0400
commit1b7e36a966ce1a0964e93eefa98c9efcbc4c323d (patch)
treeed48428b0c08941385bafd12cbe836ce354503e9 /cloudinit/util.py
parent8e97ca8cfaf75edc0b05b0dc2a2ef35c5c82221b (diff)
downloadvyos-cloud-init-1b7e36a966ce1a0964e93eefa98c9efcbc4c323d.tar.gz
vyos-cloud-init-1b7e36a966ce1a0964e93eefa98c9efcbc4c323d.zip
re-work maas datasource and headers call backs
Couple of things here: * do not re-try on user-data (404 means 'not here') * re-generate headers on retry requests LP: #1172742
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r--cloudinit/util.py4
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)