Skip to content
Snippets Groups Projects
Verified Commit 05a1da1e authored by Pedro Pombeiro's avatar Pedro Pombeiro
Browse files

Rename old GCP prefix

parent 468c2be4
No related branches found
No related tags found
1 merge request!145910Rename old GCP prefix
......@@ -4,8 +4,8 @@ module GoogleCloudPlatform
class BaseClient
CLOUD_PLATFORM_SCOPE = 'https://www.googleapis.com/auth/cloud-platform'
GCP_SUBJECT_TOKEN_ERROR_MESSAGE = 'Unable to retrieve glgo token'
GCP_TOKEN_EXCHANGE_ERROR_MESSAGE = 'Token exchange failed'
GOOGLE_CLOUD_SUBJECT_TOKEN_ERROR_MESSAGE = 'Unable to retrieve glgo token'
GOOGLE_CLOUD_TOKEN_EXCHANGE_ERROR_MESSAGE = 'Token exchange failed'
SAAS_ONLY_ERROR_MESSAGE = "This is a SaaS-only feature that can't run here"
BLANK_PARAMETERS_ERROR_MESSAGE = 'All Google Cloud parameters are required'
......@@ -69,7 +69,8 @@ def project
def handling_errors
yield
rescue RuntimeError => e
if e.message.include?(GCP_SUBJECT_TOKEN_ERROR_MESSAGE) || e.message.include?(GCP_TOKEN_EXCHANGE_ERROR_MESSAGE)
if e.message.include?(GOOGLE_CLOUD_SUBJECT_TOKEN_ERROR_MESSAGE) ||
e.message.include?(GOOGLE_CLOUD_TOKEN_EXCHANGE_ERROR_MESSAGE)
raise ::GoogleCloudPlatform::AuthenticationError, e.message
end
......
......@@ -56,12 +56,12 @@
end
it_behaves_like 'transforming the error',
message: "test #{described_class::GCP_SUBJECT_TOKEN_ERROR_MESSAGE} test",
message: "test #{described_class::GOOGLE_CLOUD_SUBJECT_TOKEN_ERROR_MESSAGE} test",
from_klass: RuntimeError,
to_klass: ::GoogleCloudPlatform::AuthenticationError
it_behaves_like 'transforming the error',
message: "test #{described_class::GCP_TOKEN_EXCHANGE_ERROR_MESSAGE} test",
message: "test #{described_class::GOOGLE_CLOUD_TOKEN_EXCHANGE_ERROR_MESSAGE} test",
from_klass: RuntimeError,
to_klass: ::GoogleCloudPlatform::AuthenticationError
......
......@@ -56,12 +56,12 @@
end
it_behaves_like 'transforming the error',
message: "test #{described_class::GCP_SUBJECT_TOKEN_ERROR_MESSAGE} test",
message: "test #{described_class::GOOGLE_CLOUD_SUBJECT_TOKEN_ERROR_MESSAGE} test",
from_klass: RuntimeError,
to_klass: ::GoogleCloudPlatform::AuthenticationError
it_behaves_like 'transforming the error',
message: "test #{described_class::GCP_TOKEN_EXCHANGE_ERROR_MESSAGE} test",
message: "test #{described_class::GOOGLE_CLOUD_TOKEN_EXCHANGE_ERROR_MESSAGE} test",
from_klass: RuntimeError,
to_klass: ::GoogleCloudPlatform::AuthenticationError
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment