From 8febd04f764c94e707cc9b70b00fa5c8454bf03d Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Thu, 29 Jan 2015 13:33:06 -0800 Subject: [PATCH] Returning response value in compute_engine_id() instead of using var. --- gcloud/datastore/_implicit_environ.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/gcloud/datastore/_implicit_environ.py b/gcloud/datastore/_implicit_environ.py index 2ee86d904603..26e6b69382e5 100644 --- a/gcloud/datastore/_implicit_environ.py +++ b/gcloud/datastore/_implicit_environ.py @@ -69,15 +69,12 @@ def compute_engine_id(): headers = {'Metadata-Flavor': 'Google'} connection = httplib.HTTPConnection(host, timeout=0.1) - content = None try: connection.request('GET', uri_path, headers=headers) response = connection.getresponse() if response.status == 200: - content = response.read() + return response.read() except socket.error: # socket.timeout or socket.error(64, 'Host is down') pass finally: connection.close() - - return content