summaryrefslogtreecommitdiff
path: root/cloudinit/url_helper.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-08-07 00:45:11 -0500
committerScott Moser <smoser@ubuntu.com>2015-08-07 00:45:11 -0500
commit89b381f01c727c8fb00724eb28bf98eafd97dbb4 (patch)
treedd3365f5658510e0ee5cb5c9992708f6036802c7 /cloudinit/url_helper.py
parent48cb8699efb5c6116dfa7b4d76d0a5fb6b3fbbbf (diff)
downloadvyos-cloud-init-89b381f01c727c8fb00724eb28bf98eafd97dbb4.tar.gz
vyos-cloud-init-89b381f01c727c8fb00724eb28bf98eafd97dbb4.zip
seems functional in test
Diffstat (limited to 'cloudinit/url_helper.py')
-rw-r--r--cloudinit/url_helper.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py
index 2141cdc5..e598661f 100644
--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -385,7 +385,6 @@ class OauthUrlHelper(object):
self.token_key = token_key
self.token_secret = token_secret
self.skew_data_file = skew_data_file
- self.skew_data = {}
self._do_oauth = True
self.skew_change_limit = 5
required = (self.token_key, self.token_secret, self.consumer_key)
@@ -445,7 +444,7 @@ class OauthUrlHelper(object):
timestamp = None
host = urlparse(url).netloc
- if host in self.skew_data:
+ if self.skew_data and host in self.skew_data:
timestamp = int(time.time()) + self.skew_data[host]
return oauth_headers(
@@ -466,21 +465,20 @@ class OauthUrlHelper(object):
def readurl(self, *args, **kwargs):
return self._wrapped(readurl, args, kwargs)
- def _exception_cb(self, extra_exception_cb, url, msg, exception):
+ def _exception_cb(self, extra_exception_cb, msg, exception):
ret = None
try:
if extra_exception_cb:
ret = extra_exception_cb(msg, exception)
finally:
- self.exception_cb(self, msg, exception)
+ self.exception_cb(msg, exception)
return ret
def _headers_cb(self, extra_headers_cb, url):
headers = {}
if extra_headers_cb:
headers = extra_headers_cb(url)
- if headers:
- headers.update(self.headers_cb(url))
+ headers.update(self.headers_cb(url))
return headers