diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-09-02 16:46:11 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-09-02 16:46:11 -0400 |
commit | 9cd6d8a7b3f5f02e3426e7af59b36a53039dd4fb (patch) | |
tree | eae557c5542599852a93a3ab165b842783793211 /cloudinit/url_helper.py | |
parent | deb6cffaa92fb5a1244c9b28f22f85bb15d46a86 (diff) | |
parent | cba8282acc1c957698480bae2d0c2032b884d80d (diff) | |
download | vyos-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.py | 12 |
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 |