Skip to content

Commit e756f08

Browse files
authored
fix: fix the message format for metadata server exception (#916)
``` RefreshError: ("Failed to ... from the Google Compute Enginemetadata service. Status: 403 ...) ```
1 parent 3a01950 commit e756f08

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

google/auth/compute_engine/_metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def get(
161161
retries += 1
162162
else:
163163
raise exceptions.TransportError(
164-
"Failed to retrieve {} from the Google Compute Engine"
164+
"Failed to retrieve {} from the Google Compute Engine "
165165
"metadata service. Compute Engine Metadata server unavailable".format(url)
166166
)
167167

@@ -172,15 +172,15 @@ def get(
172172
return json.loads(content)
173173
except ValueError as caught_exc:
174174
new_exc = exceptions.TransportError(
175-
"Received invalid JSON from the Google Compute Engine"
175+
"Received invalid JSON from the Google Compute Engine "
176176
"metadata service: {:.20}".format(content)
177177
)
178178
six.raise_from(new_exc, caught_exc)
179179
else:
180180
return content
181181
else:
182182
raise exceptions.TransportError(
183-
"Failed to retrieve {} from the Google Compute Engine"
183+
"Failed to retrieve {} from the Google Compute Engine "
184184
"metadata service. Status: {} Response:\n{}".format(
185185
url, response.status, response.data
186186
),

0 commit comments

Comments
 (0)