Repository navigation
Conversation
commented
Jan 27, 2015
|
Changes Unknown when pulling cf58724 on dhermes:fix-566 into * on GoogleCloudPlatform:master*. |
commented
Jan 28, 2015
|
Changes Unknown when pulling 5324510 on dhermes:fix-566 into * on GoogleCloudPlatform:master*. |
commented
Jan 28, 2015
|
Making an HTTP request at import time is Just Wrong (TM). We should either make an instance of a class with a property which computes |
commented
Jan 28, 2015
|
I like it. Will re-work with this in mind. I'm a little scared of what unit tests will look like. |
a53d2c8 to
1d4c4de
Compare
commented
Jan 29, 2015
commented
Jan 29, 2015
|
@tseaver I changed to using a lazy loading property with I also debated using a default Why can't GCE be detected without an HTTP request? Bah! I'm a bit hesitant with this current approach since we have a Another thing I wanted to do: set |
commented
Jan 29, 2015
|
Something like Pyramid's |
commented
Jan 29, 2015
|
Maybe we should allow applications to pass in a string to be added to the agent? |
commented
Jan 29, 2015
|
commented
Jan 29, 2015
|
@tseaver PTAL. I held off on
Will cover in another PR if you're OK with that. |
commented
Jan 29, 2015
commented
Jan 29, 2015
|
Also I had to add a |
commented
Jan 30, 2015
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
commented
Jan 30, 2015
|
Deferring the "custom" agent stuff is fine by me. |
commented
Jan 30, 2015
|
Or move the logic down into the |
commented
Jan 30, 2015
|
We want to leave the logic outside of
I'm fine with hard-coding |
commented
Jan 30, 2015
|
I was thinking more of something like this gist. |
commented
Jan 30, 2015
|
commented
Jan 30, 2015
Using a decorator to wrap a no-op function smells bad to me.
I was addressing #573 (comment). If there were "well known" apps which used the feature, then one might be able to pick their traffic out of the logs.
I had assumed that it would just use the value of |
commented
Jan 30, 2015
|
commented
Jan 30, 2015
It seemed useful to me to preserve the "library" info along with the application-specific tag.
I hadn't meant to force it at import time; rather, I would use |
commented
Jan 30, 2015
|
Using the property on Connection instances instead of setting as a class property / attribute. Fixes googleapis#566.
This prevents unnecessary HTTP requests to determine if GCE is the current environment. Also updating Test__UserAgentReifyProperty with - setUp and tearDown to make sure a fresh _UserAgentReifyProperty is associated with the Connection class in every test case - test___get___access_twice test case added to test the branches in __get__ for pre-cache and post-cache states
commented
Feb 5, 2015
commented
Feb 5, 2015
commented
Feb 5, 2015
Yes: the whole notion requires an instance to hold the cached computed values.
I don't care about the class, per se. I was assuming that the instance might be part of the API, assuming apps might care about using its methods in the same way that the connection does. |
See #566.
This should not be merged (uses lots of
pragma: NO COVER), it is just a quick and dirty way to go about it.The App Engine import is innocuous, but the Compute Engine metadata server HTTP should not happen every single time
gcloudis imported (or any sub-package / sub-module). This is the thing I want to discuss.