diff options
author | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-01-23 14:41:09 -0800 |
---|---|---|
committer | Joshua Harlow <harlowja@yahoo-inc.com> | 2014-01-23 14:41:09 -0800 |
commit | ba84f51f0143a8ca1ca5113ae932505ce1bfe5e5 (patch) | |
tree | 5250034f09e1063b441c5fa59947402df1ea9bc9 /cloudinit/util.py | |
parent | 5aa7d4ccf984ac296f58fa355bdce17d175dcc7d (diff) | |
download | vyos-cloud-init-ba84f51f0143a8ca1ca5113ae932505ce1bfe5e5.tar.gz vyos-cloud-init-ba84f51f0143a8ca1ca5113ae932505ce1bfe5e5.zip |
Skip retry and continued fetch of userdata when NOT_FOUND
When a 404 http code comes back from the fetching of ec2
data, instead of retrying immediatly stop the fetching process
and in the userdata fetching function handle this case as a
special case of no userdata being fetched (an empty string
in this case).
Diffstat (limited to 'cloudinit/util.py')
-rw-r--r-- | cloudinit/util.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/cloudinit/util.py b/cloudinit/util.py index 77f9ab36..e1263f47 100644 --- a/cloudinit/util.py +++ b/cloudinit/util.py @@ -691,7 +691,7 @@ 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_cb=None): + headers_cb=None, exception_cb=None): url = url.lstrip() if url.startswith("/"): url = "file://%s" % url @@ -708,7 +708,8 @@ def read_file_or_url(url, timeout=5, retries=10, headers_cb=headers_cb, data=data, sec_between=sec_between, - ssl_details=ssl_details) + ssl_details=ssl_details, + exception_cb=exception_cb) def load_yaml(blob, default=None, allowed=(dict,)): |