Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use "gcloud config config-helper" to read the project ID from the Google Cloud SDK #147

Merged
merged 4 commits into from
Mar 24, 2017

Conversation

theacodes
Copy link
Contributor

@theacodes theacodes commented Mar 23, 2017

Resolves #146

@theacodes theacodes added this to the 1.0.0 milestone Mar 23, 2017
@theacodes theacodes changed the title USe "gcloud config config-helper" to read the project ID from the Google Cloud SDK Use "gcloud config config-helper" to read the project ID from the Google Cloud SDK Mar 23, 2017

try:
output = subprocess.check_output([
'gcloud', 'config', 'config-helper', '--format', 'json'])

This comment was marked as spam.

This comment was marked as spam.

try:
output = subprocess.check_output([
'gcloud', 'config', 'config-helper', '--format', 'json'])
except (subprocess.CalledProcessError, OSError, IOError):

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.


try:
return configuration['configuration']['properties']['core']['project']
except KeyError:

This comment was marked as spam.

This comment was marked as spam.

"access_token": "don't use me",
"token_expiry": "2017-03-23T23:09:49Z"
},
"sentinels": {

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor Author

You definitely don't want commented out code in your commit

Trying to debug the system tests, I figured it out. Fix incoming.

@theacodes
Copy link
Contributor Author

@dhermes this should be ready for final review.

@theacodes theacodes merged commit 0c09c73 into master Mar 24, 2017
@theacodes theacodes deleted the fix-gcloud-project-detection branch March 24, 2017 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants