@@ -282,15 +282,11 @@ def generate_signed_url_v2(
282282 .. note::
283283
284284 If you are on Google Compute Engine, you can't generate a signed URL.
285- Follow `Issue 922`_ for updates on this. If you'd like to be able to
286- generate a signed URL from GCE, you can use a standard service account
287- from a JSON file rather than a GCE service account.
285+ If you'd like to be able to generate a signed URL from GCE, you can use a
286+ standard service account from a JSON file rather than a GCE service account.
288287
289- See headers `reference`_ for more details on optional arguments.
290-
291- .. _Issue 922: https://github.com/GoogleCloudPlatform/\
292- google-cloud-python/issues/922
293- .. _reference: https://cloud.google.com/storage/docs/reference-headers
288+ See headers [reference](https://cloud.google.com/storage/docs/reference-headers)
289+ for more details on optional arguments.
294290
295291 :type credentials: :class:`google.auth.credentials.Signing`
296292 :param credentials: Credentials object with an associated private key to
@@ -382,6 +378,8 @@ def generate_signed_url_v2(
382378 elements_to_sign .append (canonical .resource )
383379 string_to_sign = "\n " .join (elements_to_sign )
384380
381+ # If you are on Google Compute Engine, you can't generate a signed URL.
382+ # See https://github.com/googleapis/google-cloud-python/issues/922
385383 # Set the right query parameters.
386384 if access_token and service_account_email :
387385 signature = _sign_message (string_to_sign , access_token , service_account_email )
@@ -446,16 +444,11 @@ def generate_signed_url_v4(
446444 .. note::
447445
448446 If you are on Google Compute Engine, you can't generate a signed URL.
449- Follow `Issue 922`_ for updates on this. If you'd like to be able to
450- generate a signed URL from GCE, you can use a standard service account
451- from a JSON file rather than a GCE service account.
452-
453- See headers `reference`_ for more details on optional arguments.
454-
455- .. _Issue 922: https://github.com/GoogleCloudPlatform/\
456- google-cloud-python/issues/922
457- .. _reference: https://cloud.google.com/storage/docs/reference-headers
447+ If you'd like to be able to generate a signed URL from GCE,you can use a
448+ standard service account from a JSON file rather than a GCE service account.
458449
450+ See headers [reference](https://cloud.google.com/storage/docs/reference-headers)
451+ for more details on optional arguments.
459452
460453 :type credentials: :class:`google.auth.credentials.Signing`
461454 :param credentials: Credentials object with an associated private key to
@@ -543,6 +536,8 @@ def generate_signed_url_v4(
543536 request_timestamp = _request_timestamp
544537 datestamp = _request_timestamp [:8 ]
545538
539+ # If you are on Google Compute Engine, you can't generate a signed URL.
540+ # See https://github.com/googleapis/google-cloud-python/issues/922
546541 client_email = service_account_email
547542 if not access_token or not service_account_email :
548543 ensure_signed_credentials (credentials )
0 commit comments