-
Notifications
You must be signed in to change notification settings - Fork 342
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
Move module_utils out of subdir #26
Move module_utils out of subdir #26
Conversation
bbccfba
to
768f353
Compare
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.
This largely looks good, I want to pull this and the community PR down and do a bunch of extra testing to be safe though.
just to note, that ansible-base "routing" will include module_utils for backwards compatibility with 2.9, I would test/ensure that it works with this relocation. Worst case scenario you might be able to just make the old locations symlinks (as long as the internals are also not rearranged). |
@bcoca Redirection of module_utils is pretty broken right now, and I don't think this PR introduces any new concerns. I was able to get ansible/ansible#67684 working for
Error:
Adding an empty |
^ @nitzmahone as the person that can 'unbreak' the redirection issues |
@flowerysong thanks for this, I think this is definitely the right move now that we have our own namespace to use. |
@flowerysong I haven't forgotten about this PR, just waiting on 67684 |
9c3ee83
to
db57127
Compare
@flowerysong I've split off the unit test fix so that we can get that in without the rest of this change. Given we'll need to coordinate this change across the two repos I don't know how long it'll take to get the module_util migrations into place, we should at least get these unit tests fixed up. |
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.
@jillr @s-hertel Some follow up questions:
Since @flowerysong has taken the time to clean up the imports and the ordering how would you feel about sanity tests for:
- import order
- unused imports
- multiple imports on a single line
@tremble I'm +1 unused imports, less so the others. I'd prefer not to get too strict on formatting via sanity tests without a much larger conversation and documented guidelines as I think that could increase contributor friction without a ton of benefit. The network team is using black for their collections so there's a model there we could work from but we'll need to do more than just turning on sanity tests for it. |
* Use relative imports * Always get dict transformations from their canonical home * Split imports by line to match tremble's other refactoring * Make import order more consistent
bcd3389
to
4facc8d
Compare
+1 from my side. |
Also +1 |
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.
Thanks very much for this work @flowerysong!
* Move module_utils out of subdir and update imports * Use relative imports * Always get dict transformations from their canonical home * Split imports by line to match tremble's other refactoring * Make import order more consistent * Temporarily restore legacy module_utils files
…r(e) or e.me… (#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
…r(e) or e.me… (ansible-collections#26) * Py3 compat error handling: use to_native(e) instead of str(e) or e.message * PR comment changes, use fail_json_aws and is_boto3_error_code This commit was initially merged in https://github.com/ansible-collections/community.aws See: ansible-collections/community.aws@ffe14f9
SUMMARY
The migration script preserved the separation of (most of) our util files into an
aws
subdirectory inmodule_utils
; it would be nice to get rid of this naming redundancy/inconsistency before the collection has a stable release and starts being widely used.The split repos make this complicated to do without breaking CI. This PR creates the new files and adjusts all of the imports on this side. ansible-collections/community.aws#23 will theoretically pass once this is merged, and then it will be possible to remove the old files in a third PR.
ISSUE TYPE
COMPONENT NAME