Skip to content
This repository has been archived by the owner on Jan 18, 2025. It is now read-only.

Factor metadata interface into a separate module #520

Merged
merged 17 commits into from
Jun 10, 2016

Conversation

elibixby
Copy link
Contributor

@elibixby elibixby commented Jun 8, 2016

First in a series of PRs which are loosely based on #476

Realized that Metadata Server interaction should be decoupled from GCE App Assertion Credentials. gce.AppAssertionCredentials.

'instance/service-accounts/default/')
META = _METADATA_ROOT + 'token'
_DEFAULT_EMAIL_METADATA = _METADATA_ROOT + 'email'
# Backwards Compat

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

if not http_request:
http_request = self._client.request

r_string = '/?recursive=true' if recursive else ''

This comment was marked as spam.

@elibixby
Copy link
Contributor Author

elibixby commented Jun 8, 2016

@jonparrott Things are green now. PTAL. =)

@@ -105,6 +73,8 @@ def __init__(self, scope='', **kwargs):
# Assertion type is no longer used, but still in the
# parent class signature.
super(AppAssertionCredentials, self).__init__(None)

# Cache until Metadata Server supports Cache-Control Header

This comment was marked as spam.

This comment was marked as spam.



def get_service_account_info(service_account='default', http_request=None):
""" Get information about a service account from the metadata server.

This comment was marked as spam.

@elibixby
Copy link
Contributor Author

elibixby commented Jun 9, 2016

@jonparrott Not sure if you get notifications when I push... so bump.

http_request = httplib2.Http().request

if kwargs:
path.append('?' + urlencode(kwargs))

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@googlebot
Copy link

We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm.

@elibixby
Copy link
Contributor Author

@googlebot I confirm

@theacodes
Copy link
Contributor

@googlebot we're going to deactivate you.

@theacodes
Copy link
Contributor

Merging, @nathanielmanistaatgoogle if you have any objections here we can address before we release this code.

@theacodes theacodes merged commit c82816c into googleapis:master Jun 10, 2016
@theacodes theacodes mentioned this pull request Jul 28, 2016
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.

3 participants