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

Rename module_utils/elb_utils.py to module_utils/elbv2_utils.py #2285

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

alinabuzachis
Copy link
Collaborator

SUMMARY

Rename module_utils/elb_utils.py to module_utils/elbv2_utils.py, since it includes utilities for the elbv2 client and we may also have utilities just for elb.

ISSUE TYPE
  • Bugfix Pull Request
  • Docs Pull Request
  • Feature Pull Request
  • New Module Pull Request
COMPONENT NAME
ADDITIONAL INFORMATION

Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/c72ffa453f734a61838bf237dfab5ef0

✔️ ansible-galaxy-importer SUCCESS in 4m 41s
✔️ build-ansible-collection SUCCESS in 10m 34s
✔️ ansible-test-splitter SUCCESS in 4m 20s
✔️ integration-amazon.aws-1 SUCCESS in 32m 56s
✔️ integration-amazon.aws-2 SUCCESS in 10m 20s
✔️ integration-community.aws-1 SUCCESS in 17m 54s
Skipped 41 jobs

@tremble
Copy link
Contributor

tremble commented Sep 5, 2024

Not completely against the idea of moving this code about, but will ask the question if module_utils/elbv2_utils is the right name...

I'd either go for module_utils/elbv2/utils.py or possibly splitting the contents into multiple files under elbv2/ I would also ask where we want folks loading things like the error handler / exception from: maybe module_utils/elbv2? (probably needs to live in module_utils/elbv2/utils.py to avoid loops though)

@tremble
Copy link
Contributor

tremble commented Sep 10, 2024

Not completely against the idea of moving this code about, but will ask the question if module_utils/elbv2_utils is the right name...

To answer my own question here. We can't use module_utils/elbv2/ because of the "empty-init" policy:
https://docs.ansible.com/ansible-core/devel/dev_guide/testing/sanity/empty-init.html

For others (module_utils), we want the possibility of using Python namespaces which an empty init.py will allow for.

Personally I think this policy is being a little overly restrictive, but it is what it is.

… it include util esed by the elbv2 client

Signed-off-by: Alina Buzachis <[email protected]>
Signed-off-by: Alina Buzachis <[email protected]>
Signed-off-by: Alina Buzachis <[email protected]>
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/e4ff9c1eea66497ba2b7a8c95b33b188

✔️ ansible-galaxy-importer SUCCESS in 8m 12s
✔️ build-ansible-collection SUCCESS in 10m 43s
✔️ ansible-test-splitter SUCCESS in 4m 16s
integration-amazon.aws-1 FAILURE in 1h 00m 05s
✔️ integration-amazon.aws-2 SUCCESS in 13m 11s
✔️ integration-community.aws-1 SUCCESS in 16m 09s
Skipped 41 jobs

@@ -0,0 +1,2 @@
minor_changes:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
minor_changes:
breaking_changes:

Technically this is a breaking change, but I think it's the right change to make in this case.

Further thought:
It's a breaking change because someone can in theory import from module_utils/elb_utils/...

Do we want people directly importing things from module_utils/elbv2_utils ? The bulk of this code is just calls wrapped with helpers.

Do we in fact move this to module_utils/_elbv2 (marking the module private), and only directly import AnsibleELBv2Error which we want to publicly expose (for the other calls we import ._elbv2 _elbv2_utils and then do things like _elbv2_utils.describe_load_balancer_attributes(self.connection, self.elb["LoadBalancerArn"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants