Skip to content
This repository has been archived by the owner on Nov 5, 2019. It is now read-only.

Use transport module for GCE environment check. #612

Merged
merged 1 commit into from
Aug 16, 2016

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Aug 11, 2016

Fixes #599.

_GCE_METADATA_HOST = '169.254.169.254'
_METADATA_FLAVOR_HEADER = 'Metadata-Flavor'
_GCE_METADATA_URI = 'http://169.254.169.254'
_METADATA_FLAVOR_HEADER = 'metadata-flavor' # lowercase header

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor Author

dhermes commented Aug 11, 2016

@nathanielmanistaatgoogle PTAL I pushed a 2nd commit with some of the changes you suggest (see my responses for the changes I didn't make).

I also removed a no-longer relevant TODO (about separation from google-api-python-client) and the __author__ from the test_client file. (I did this because I noticed them when adding a module level constant in test_client.)

connection = six.moves.http_client.HTTPConnection(
_GCE_METADATA_HOST, timeout=GCE_METADATA_TIMEOUT)

http = transport.get_http_object(timeout=GCE_METADATA_TIMEOUT)

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@theacodes
Copy link
Contributor

LGTM for now.

@dhermes
Copy link
Contributor Author

dhermes commented Aug 11, 2016

@jonparrott Can you think of any reason that this wouldn't have been the original implementation?

@nathanielmanistaatgoogle Any issues?

@theacodes
Copy link
Contributor

I'm not sure, I didn't write the original environment check. /shruggie

@dhermes
Copy link
Contributor Author

dhermes commented Aug 11, 2016

Got heem

@dhermes dhermes force-pushed the fix-599 branch 2 times, most recently from 3eb4077 to 2a76227 Compare August 15, 2016 16:00
@dhermes
Copy link
Contributor Author

dhermes commented Aug 15, 2016

@nathanielmanistaatgoogle PTAL. Pretty please remind me to squash in your LGTM. (@jonparrott is there no such thing as a squash-bot / remind-bot service for GitHub?)

@theacodes
Copy link
Contributor

@dhermes what would you want it to do?

@dhermes
Copy link
Contributor Author

dhermes commented Aug 15, 2016

Block a merge until commits with the word SQUASH are gone? Or until a squash label is removed.

@theacodes
Copy link
Contributor

I could probably add that to @dpebot once he's functional.

@dhermes
Copy link
Contributor Author

dhermes commented Aug 15, 2016

Ha awesome!

@nathanielmanistaatgoogle
Copy link
Contributor

Change content looks good; squash and merge.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants