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

Using httplib instead of httplib2 to get GCE metadata. #577

Merged
merged 3 commits into from
Jan 29, 2015

Conversation

dhermes
Copy link
Contributor

@dhermes dhermes commented Jan 29, 2015

Fixes #575.

Feel free to run the bash script I included in the bug to torture test the fix.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 29, 2015
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling b35c64f on dhermes:fix-575 into bf93d46 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 29, 2015

I realized I need to use the _Httplib stub in the default fall through as well. Will fix when back at keyboard

Both
- test_set_explicit_None_wo_env_var_set
- test_no_env_var_set
fall-through to the GCE check, but were actually making real HTTP
calls before. This makes sure httplib is always stubbed out but
also allows modification of that stub.
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8dc13b5 on dhermes:fix-575 into bf93d46 on GoogleCloudPlatform:master.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 29, 2015

@tseaver PTAL, with 8dc13b5 I made sure all calls to set_default_dataset_id have the httplib stub.

connection.request('GET', uri_path, headers=headers)
response = connection.getresponse()
if response.status == 200:
content = response.read()

This comment was marked as spam.

This comment was marked as spam.

@dhermes
Copy link
Contributor Author

dhermes commented Jan 29, 2015

@tseaver Any other comments before I push the content = None fix?

@tseaver
Copy link
Contributor

tseaver commented Jan 29, 2015

Nope -- "merge when ready, Gridley!"

dhermes added a commit that referenced this pull request Jan 29, 2015
Using httplib instead of httplib2 to get GCE metadata.
@dhermes dhermes merged commit d858ff0 into googleapis:master Jan 29, 2015
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 8febd04 on dhermes:fix-575 into bf93d46 on GoogleCloudPlatform:master.

@dhermes dhermes deleted the fix-575 branch January 29, 2015 21:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

'_implicit_environ.compute_engine_id()' may raise
4 participants