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.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py
index f3c0cf9c..caa88435 100644
--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -95,7 +95,7 @@ def read_file_or_url(url, **kwargs):
code = e.errno
if e.errno == ENOENT:
code = NOT_FOUND
- raise UrlError(cause=e, code=code, headers=None, url=url)
+ raise UrlError(cause=e, code=code, headers=None, url=url) from e
return FileResponse(file_path, contents=contents)
else:
return readurl(url, **kwargs)
@@ -575,8 +575,8 @@ def oauth_headers(url, consumer_key, token_key, token_secret, consumer_secret,
timestamp=None):
try:
import oauthlib.oauth1 as oauth1
- except ImportError:
- raise NotImplementedError('oauth support is not available')
+ except ImportError as e:
+ raise NotImplementedError('oauth support is not available') from e
if timestamp:
timestamp = str(timestamp)