summaryrefslogtreecommitdiff
path: root/cloudinit/url_helper.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-09-02 16:46:11 -0400
committerScott Moser <smoser@ubuntu.com>2015-09-02 16:46:11 -0400
commit9cd6d8a7b3f5f02e3426e7af59b36a53039dd4fb (patch)
treeeae557c5542599852a93a3ab165b842783793211 /cloudinit/url_helper.py
parentdeb6cffaa92fb5a1244c9b28f22f85bb15d46a86 (diff)
parentcba8282acc1c957698480bae2d0c2032b884d80d (diff)
downloadvyos-cloud-init-9cd6d8a7b3f5f02e3426e7af59b36a53039dd4fb.tar.gz
vyos-cloud-init-9cd6d8a7b3f5f02e3426e7af59b36a53039dd4fb.zip
sync curtin reporting changes back to cloud-init
this pulls in the reporting framework that we'd been working on in curtin back to cloud-init.
Diffstat (limited to 'cloudinit/url_helper.py')
-rw-r--r--cloudinit/url_helper.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py
index ce6b5444..a93847ce 100644
--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -211,10 +211,14 @@ def readurl(url, data=None, timeout=None, retries=0, sec_between=1,
manual_tries = 1
if retries:
manual_tries = max(int(retries) + 1, 1)
- if not headers:
- headers = {
- 'User-Agent': 'Cloud-Init/%s' % (version.version_string()),
- }
+
+ def_headers = {
+ 'User-Agent': 'Cloud-Init/%s' % (version.version_string()),
+ }
+ if headers:
+ def_headers.update(headers)
+ headers = def_headers
+
if not headers_cb:
def _cb(url):
return headers