Remove warning while looking up project_id (#184)
This commit is contained in:
parent
8894a08470
commit
dc8b127549
|
@ -139,13 +139,14 @@ module Google
|
||||||
end
|
end
|
||||||
module_function :warn_if_cloud_sdk_credentials
|
module_function :warn_if_cloud_sdk_credentials
|
||||||
|
|
||||||
|
# Finds project_id from gcloud CLI configuration
|
||||||
def load_gcloud_project_id
|
def load_gcloud_project_id
|
||||||
gcloud = GCLOUD_WINDOWS_COMMAND if OS.windows?
|
gcloud = GCLOUD_WINDOWS_COMMAND if OS.windows?
|
||||||
gcloud = GCLOUD_POSIX_COMMAND unless OS.windows?
|
gcloud = GCLOUD_POSIX_COMMAND unless OS.windows?
|
||||||
config = MultiJson.load(`#{gcloud} #{GCLOUD_CONFIG_COMMAND}`)
|
config = MultiJson.load(`#{gcloud} #{GCLOUD_CONFIG_COMMAND}`)
|
||||||
config['configuration']['properties']['core']['project']
|
config['configuration']['properties']['core']['project']
|
||||||
rescue
|
rescue
|
||||||
warn 'Unable to determine project id.'
|
nil
|
||||||
end
|
end
|
||||||
module_function :load_gcloud_project_id
|
module_function :load_gcloud_project_id
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue