diff options
author | Chris Patterson <cpatterson@microsoft.com> | 2022-02-11 23:40:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-11 22:40:45 -0600 |
commit | 0b41b359a70bbbf3a648862a9b849d60b9ff6c3b (patch) | |
tree | c53959a1e5346db352e5b5a14a47180092c3e3c4 /cloudinit/url_helper.py | |
parent | a62d04e081831be82b3d26c94fee5aa40d7c0802 (diff) | |
download | vyos-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.py | 7 |
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( |