summaryrefslogtreecommitdiff
path: root/cloudinit/url_helper.py
diff options
context:
space:
mode:
authorChris Patterson <cpatterson@microsoft.com>2022-02-11 23:40:45 -0500
committerGitHub <noreply@github.com>2022-02-11 22:40:45 -0600
commit0b41b359a70bbbf3a648862a9b849d60b9ff6c3b (patch)
treec53959a1e5346db352e5b5a14a47180092c3e3c4 /cloudinit/url_helper.py
parenta62d04e081831be82b3d26c94fee5aa40d7c0802 (diff)
downloadvyos-cloud-init-0b41b359a70bbbf3a648862a9b849d60b9ff6c3b.tar.gz
vyos-cloud-init-0b41b359a70bbbf3a648862a9b849d60b9ff6c3b.zip
sources/azure: address mypy/pyright typing complaints (#1245)
Raise runtime errors for unhandled cases which would cause other exceptions. Ignore types for a few cases where a non-trivial refactor would be required to prevent the warning. Signed-off-by: Chris Patterson <cpatterson@microsoft.com>
Diffstat (limited to 'cloudinit/url_helper.py')
-rw-r--r--cloudinit/url_helper.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py
index 790e2fbf..5b2f2ef9 100644
--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -188,7 +188,7 @@ def readurl(
infinite=False,
log_req_resp=True,
request_method=None,
-):
+) -> UrlResponse:
"""Wrapper around requests.Session to read the url and retry if necessary
:param url: Mandatory url to request.
@@ -339,9 +339,8 @@ def readurl(
sec_between,
)
time.sleep(sec_between)
- if excps:
- raise excps[-1]
- return None # Should throw before this...
+
+ raise excps[-1]
def wait_for_url(