diff options
author | Chad Smith <chad.smith@canonical.com> | 2019-12-02 16:24:18 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-02 16:24:18 -0700 |
commit | f69d33a723b805fec3ee70c3a6127c8cadcb02d8 (patch) | |
tree | 5cd3ed55526a461b3581a2ddeec7853ae766e6ea /cloudinit/sources/helpers | |
parent | f1a73f54fab7a0aef8adc67d49a07c5a26f9f875 (diff) | |
download | vyos-cloud-init-f69d33a723b805fec3ee70c3a6127c8cadcb02d8.tar.gz vyos-cloud-init-f69d33a723b805fec3ee70c3a6127c8cadcb02d8.zip |
url_helper: read_file_or_url should pass headers param into readurl (#66)
Headers param was accidentally omitted and no longer passed through to
readurl due to a previous commit.
To avoid this omission of params in the future, drop positional param
definitions from read_file_or_url and pass all kwargs through to readurl
when we are not operating on a file.
In util:read_seeded, correct the case where invalid positional param
file_retries was being passed into read_file_or_url.
Also drop duplicated file:// prefix addition from read_seeded because
read_file_or_url does that work anyway.
LP: #1854084
Diffstat (limited to 'cloudinit/sources/helpers')
-rwxr-xr-x | cloudinit/sources/helpers/azure.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/cloudinit/sources/helpers/azure.py b/cloudinit/sources/helpers/azure.py index f1fba175..f5cdb3fd 100755 --- a/cloudinit/sources/helpers/azure.py +++ b/cloudinit/sources/helpers/azure.py @@ -183,14 +183,16 @@ class AzureEndpointHttpClient(object): if secure: headers = self.headers.copy() headers.update(self.extra_secure_headers) - return url_helper.read_file_or_url(url, headers=headers) + return url_helper.read_file_or_url(url, headers=headers, timeout=5, + retries=10) def post(self, url, data=None, extra_headers=None): headers = self.headers if extra_headers is not None: headers = self.headers.copy() headers.update(extra_headers) - return url_helper.read_file_or_url(url, data=data, headers=headers) + return url_helper.read_file_or_url(url, data=data, headers=headers, + timeout=5, retries=10) class GoalState(object): |