aboutsummaryrefslogtreecommitdiff
path: root/oauth2client/contrib/_metadata.py
diff options
context:
space:
mode:
authorDanny Hermes <daniel.j.hermes@gmail.com>2016-07-29 11:24:17 -0700
committerDanny Hermes <daniel.j.hermes@gmail.com>2016-08-01 15:08:46 -0700
commit80fff4bda1be77c479c954cdf5ad8a2ba238cf6d (patch)
tree4a39d91b340a4297a761322ba704bc713a3a6785 /oauth2client/contrib/_metadata.py
parenteb019c2dadfbcefccfcaff4d58fc2112ed584825 (diff)
downloadoauth2client-80fff4bda1be77c479c954cdf5ad8a2ba238cf6d.tar.gz
Remove httplib2 imports from non-transport modules.
Now all usage of httplib2 is concentrated in tests and in the oauth2client.transport module. This does not yet cover all behavior that implicitly relies on httplib2 in these modules, so there is still work to be done.
Diffstat (limited to 'oauth2client/contrib/_metadata.py')
-rw-r--r--oauth2client/contrib/_metadata.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/oauth2client/contrib/_metadata.py b/oauth2client/contrib/_metadata.py
index 10e6a69..ad12ef7 100644
--- a/oauth2client/contrib/_metadata.py
+++ b/oauth2client/contrib/_metadata.py
@@ -20,7 +20,6 @@ See https://cloud.google.com/compute/docs/metadata
import datetime
import json
-import httplib2
from six.moves import http_client
from six.moves.urllib import parse as urlparse
@@ -51,7 +50,8 @@ def get(http_request, path, root=METADATA_ROOT, recursive=None):
A dictionary if the metadata server returns JSON, otherwise a string.
Raises:
- httplib2.Httplib2Error if an error corrured while retrieving metadata.
+ http_client.HTTPException if an error corrured while
+ retrieving metadata.
"""
url = urlparse.urljoin(root, path)
url = util._add_query_parameter(url, 'recursive', recursive)
@@ -68,7 +68,7 @@ def get(http_request, path, root=METADATA_ROOT, recursive=None):
else:
return decoded
else:
- raise httplib2.HttpLib2Error(
+ raise http_client.HTTPException(
'Failed to retrieve {0} from the Google Compute Engine'
'metadata service. Response:\n{1}'.format(url, response))