summaryrefslogtreecommitdiff
path: root/cloudinit/url_helper.py
diff options
context:
space:
mode:
Diffstat (limited to 'cloudinit/url_helper.py')
-rw-r--r--cloudinit/url_helper.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py
index 4e814a5f..36289af5 100644
--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -258,9 +258,10 @@ def readurl(url, data=None, timeout=None, retries=0, sec_between=1,
# ssl exceptions are not going to get fixed by waiting a
# few seconds
break
- if exception_cb and exception_cb(req_args.copy(), excps[-1]):
- # if an exception callback was given it should return None
- # a true-ish value means to break and re-raise the exception
+ if exception_cb and not exception_cb(req_args.copy(), excps[-1]):
+ # if an exception callback was given, it should return True
+ # to continue retrying and False to break and re-raise the
+ # exception
break
if i + 1 < manual_tries and sec_between > 0:
LOG.debug("Please wait %s seconds while we wait to try again",