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

Splitup core.py and move non-EC2 code from ec2.py #649

Merged

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Jan 30, 2022

SUMMARY

Many of the functions in ec2.py were there primarily as a quirk of the AWS utility code living solely in ec2.py at the time it was written (no other aws utility code existed at the time). Since it isn't specific to the EC2 service, split it out.

Similarly, the core.py code came from a time when we were in with the rest of the Ansible code, so it became a general dumping ground. We don't need to worry about collisions with non-AWS module_util code now, let's break it apart to avoid potential circular dependencies.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/module_utils/ec2.py
plugins/module_utils/core.py

ADDITIONAL INFORMATION

@tremble tremble added the do_not_backport This PR should not be backported to stable- branches unless absolutely necessary label Jan 30, 2022
@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request module_utils module_utils new_plugin New plugin plugins plugin (any type) labels Jan 30, 2022
@softwarefactory-project-zuul

This comment has been minimized.

@softwarefactory-project-zuul

This comment has been minimized.

@softwarefactory-project-zuul

This comment has been minimized.

@tremble tremble force-pushed the refactor branch 2 times, most recently from 4f683fa to 9cfb3d6 Compare January 30, 2022 20:19
@softwarefactory-project-zuul

This comment has been minimized.

@softwarefactory-project-zuul

This comment has been minimized.

@softwarefactory-project-zuul

This comment has been minimized.

@softwarefactory-project-zuul

This comment has been minimized.

@tremble

This comment has been minimized.

@softwarefactory-project-zuul

This comment has been minimized.

@tremble
Copy link
Contributor Author

tremble commented Jan 31, 2022

recheck

@softwarefactory-project-zuul
Copy link
Contributor

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Feb 1, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 0001947 into ansible-collections:main Feb 1, 2022
softwarefactory-project-zuul bot pushed a commit to ansible-collections/community.aws that referenced this pull request Feb 1, 2022
…aws (#914)

Fix unit tests which broke due to things being moved about in amazon.aws

Depends-On: ansible/ansible-zuul-jobs#1324
SUMMARY
ansible-collections/amazon.aws#649 moved a few things around, including a "private" wrapper class.
The shuffles broke part of the monkey patching in some unit tests, and the private wrapper class wasn't made available in the old location (it's private, using it might result in things breaking)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
tests/unit/plugins/modules/test_aws_api_gateway.py
tests/unit/plugins/modules/test_ec2_vpc_vpn.py
ADDITIONAL INFORMATION
CC @marknet15

Reviewed-by: Gonéri Le Bouder <[email protected]>
@tremble tremble deleted the refactor branch April 20, 2022 07:29
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Sep 18, 2023
…sible-collections#933)

ec2_asg: Add functionality to detach specified instances from ASG 

SUMMARY

Adds feature to detach specified instances from a AutoScalingGroup rather than terminating them directly.
Detached instances are not terminated and can be managed independently.

Implements ansible-collections#649
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_asg
ADDITIONAL INFORMATION


Makes use of
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/autoscaling.html#AutoScaling.Client.detach_instances

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Jill R <None>
Reviewed-by: Joseph Torcasso <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Sep 18, 2023
…sible-collections#933)

ec2_asg: Add functionality to detach specified instances from ASG 

SUMMARY

Adds feature to detach specified instances from a AutoScalingGroup rather than terminating them directly.
Detached instances are not terminated and can be managed independently.

Implements ansible-collections#649
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_asg
ADDITIONAL INFORMATION


Makes use of
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/autoscaling.html#AutoScaling.Client.detach_instances

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Jill R <None>
Reviewed-by: Joseph Torcasso <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
…sible-collections#933)

ec2_asg: Add functionality to detach specified instances from ASG 

SUMMARY

Adds feature to detach specified instances from a AutoScalingGroup rather than terminating them directly.
Detached instances are not terminated and can be managed independently.

Implements ansible-collections#649
ISSUE TYPE


Feature Pull Request

COMPONENT NAME

ec2_asg
ADDITIONAL INFORMATION


Makes use of
https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/autoscaling.html#AutoScaling.Client.detach_instances

Reviewed-by: Alina Buzachis <None>
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Jill R <None>
Reviewed-by: Joseph Torcasso <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Sep 19, 2024
…aws (ansible-collections#914)

Fix unit tests which broke due to things being moved about in amazon.aws

Depends-On: ansible/ansible-zuul-jobs#1324
SUMMARY
ansible-collections#649 moved a few things around, including a "private" wrapper class.
The shuffles broke part of the monkey patching in some unit tests, and the private wrapper class wasn't made available in the old location (it's private, using it might result in things breaking)
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
tests/unit/plugins/modules/test_aws_api_gateway.py
tests/unit/plugins/modules/test_ec2_vpc_vpn.py
ADDITIONAL INFORMATION
CC @marknet15

Reviewed-by: Gonéri Le Bouder <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@3e30e37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review do_not_backport This PR should not be backported to stable- branches unless absolutely necessary feature This issue/PR relates to a feature request mergeit Merge the PR (SoftwareFactory) module_utils module_utils module module needs_maintainer new_plugin New plugin plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants