|
48 | 48 | ) |
49 | 49 |
|
50 | 50 | # Help message when no credentials can be found. |
51 | | -_HELP_MESSAGE = """\ |
52 | | -Could not automatically determine credentials. Please set {env} or \ |
53 | | -explicitly create credentials and re-run the application. For more \ |
54 | | -information, please see \ |
55 | | -https://cloud.google.com/docs/authentication/getting-started |
56 | | -""".format( |
57 | | - env=environment_vars.CREDENTIALS |
58 | | -).strip() |
| 51 | +_CLOUD_SDK_MISSING_CREDENTIALS = """\ |
| 52 | +Your default credentials were not found. To set up Application Default Credentials, \ |
| 53 | +see https://cloud.google.com/docs/authentication/external/set-up-adc for more information.\ |
| 54 | +""" |
59 | 55 |
|
60 | 56 | # Warning when using Cloud SDK user credentials |
61 | 57 | _CLOUD_SDK_CREDENTIALS_WARNING = """\ |
62 | 58 | Your application has authenticated using end user credentials from Google \ |
63 | 59 | Cloud SDK without a quota project. You might receive a "quota exceeded" \ |
64 | | -or "API not enabled" error. We recommend you rerun \ |
65 | | -`gcloud auth application-default login` and make sure a quota project is \ |
66 | | -added. Or you can use service accounts instead. For more information \ |
67 | | -about service accounts, see https://cloud.google.com/docs/authentication/""" |
| 60 | +or "API not enabled" error. See the following page for troubleshooting: \ |
| 61 | +https://cloud.google.com/docs/authentication/adc-troubleshooting/user-creds. \ |
| 62 | +""" |
68 | 63 |
|
69 | 64 | # The subject token type used for AWS external_account credentials. |
70 | 65 | _AWS_SUBJECT_TOKEN_TYPE = "urn:ietf:params:aws:token-type:aws4_request" |
@@ -650,4 +645,4 @@ def default(scopes=None, request=None, quota_project_id=None, default_scopes=Non |
650 | 645 | ) |
651 | 646 | return credentials, effective_project_id |
652 | 647 |
|
653 | | - raise exceptions.DefaultCredentialsError(_HELP_MESSAGE) |
| 648 | + raise exceptions.DefaultCredentialsError(_CLOUD_SDK_MISSING_CREDENTIALS) |
0 commit comments