-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Added partion to client meta object #1027
Conversation
Current coverage is 97.60% (diff: 100%)@@ develop #1027 diff @@
==========================================
Files 44 44
Lines 6894 6898 +4
Methods 0 0
Messages 0 0
Branches 0 0
==========================================
+ Hits 6729 6733 +4
Misses 165 165
Partials 0 0
|
Can you give me a little background info on how you'd use the partition information for a given client? I'd just like to understand the use case a little better. |
This is specifically for a stage in our tooling where we enhance cloudtrails information with data we manually pull from the API. At the moment we have a hard coded mapping from regions to partition so that our scraping tool (similar to netflix edda) is able to populate the cloudtrails record with more data before forwarding it to our log aggregation platform. This works fine for us, but it seemed like a cleaner solution to have it available from the client object. Our current mapping code actually uses the botocore data files to lookup the region names and work out the partition, very similar to my submitted pull request. |
Seems reasonable to me. Our @kyleknap @JordonPhillips any concerns? |
@jamesls I am fine with this and yes let's get these moved over from integration tests to unit or functional. |
I have moved the tests to the unit tests |
Looks good to me. I think I'd still like to also see a functional test that uses a real client via |
I have added functional tests as requested. |
Any update on whether this can be merged? |
Is there anything else I need to do for this pull request? |
Could you remove the Otherwise, the test updates look good to me, let's just get one more reviewer to look at it. |
Made the partion name available in the client meta object Added unit tests for partition in client metadata Added functional tests for partition in client metadata
I have now removed tests/coverage.xml, sorry about that. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. @jamesls should be good to merge
Merged, thanks for the pull request. |
I found that I needed access to the partition being used for a particular client, so that I can write tools that work in both normal AWS regions as well as GovCloud and China.
I view this as a feature similar to the region_name property of the client meta object.
I have added the partition as a property on the client meta object.
I have added unit tests for new meta property.
The one part I am not sure about to what to do if no partition is set for an endpoint_config.
For the moment I have set it to be None, which seems like a reasonable fallback, though I am happy for advice on a better default value. Possibly just setting 'aws' as the fallback partition.