-
Notifications
You must be signed in to change notification settings - Fork 397
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
Prepare ec2_placement_group* module for promotion #2167
Prepare ec2_placement_group* module for promotion #2167
Conversation
This change depends on a change that failed to merge. Change ansible-collections/amazon.aws#2322 is needed. |
Docs Build 📝Thank you for contribution!✨ This PR has been merged and your docs changes will be incorporated when they are next published. |
Build failed. ✔️ ansible-galaxy-importer SUCCESS in 3m 29s (non-voting) |
response = connection.describe_placement_groups(GroupNames=[name]) | ||
placement_group = response["PlacementGroups"][0] | ||
response = describe_ec2_placement_groups(connection, GroupNames=[name]) | ||
placement_group = response[0] |
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.
You should test that the response is not empty
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.
The search for an existing placement group is handled in the main logic. Therefore, this function is called only after successfully creating the placement group. As a result, the response will never be empty whenever this function is invoked.
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 18s (non-voting) |
recheck |
Build failed.
|
Build failed.
|
recheck |
Build succeeded. ✔️ ansible-galaxy-importer SUCCESS in 3m 52s (non-voting) |
response = create_ec2_placement_group(connection, **params) | ||
module.exit_json(changed=True, placement_group=get_placement_group_information(connection, name)) |
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.
response = create_ec2_placement_group(connection, **params) | |
module.exit_json(changed=True, placement_group=get_placement_group_information(connection, name)) | |
response = create_ec2_placement_group(connection, **params) | |
response = camel_dict_to_snake_dict(response, ignore_list=["Tags"]) | |
if "Tags" in response: | |
response["tags"] = boto3_tag_list_to_ansible_dict(response.get("Tags", [])) | |
del response["Tags"] | |
module.exit_json(changed=True, placement_group=response) |
The call to get_placement_group_information
is not required it adds more delay in the process.
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.
@GomathiselviS this change was not adressed
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.
tests/integration/targets/ec2_placement_group/tasks/env_cleanup.yml
Outdated
Show resolved
Hide resolved
Build succeeded. ❌ ansible-galaxy-importer FAILURE in 4m 43s (non-voting) |
recheck |
Build succeeded. ❌ ansible-galaxy-importer FAILURE in 5m 51s (non-voting) |
Build succeeded (gate pipeline). ✔️ ansible-galaxy-importer SUCCESS in 3m 18s (non-voting) |
290e89a
into
ansible-collections:main
…s#2167) SUMMARY This PR refactors ec2_placement_group*. Depends-On: ansible-collections/amazon.aws#2322 Refer: https://issues.redhat.com/browse/ACA-1886 ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request New Module Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin Reviewed-by: GomathiselviS <[email protected]> Reviewed-by: Alina Buzachis
…s#2167) SUMMARY This PR refactors ec2_placement_group*. Depends-On: ansible-collections/amazon.aws#2322 Refer: https://issues.redhat.com/browse/ACA-1886 ISSUE TYPE Bugfix Pull Request Docs Pull Request Feature Pull Request New Module Pull Request COMPONENT NAME ADDITIONAL INFORMATION Reviewed-by: Bikouo Aubin Reviewed-by: GomathiselviS <[email protected]> Reviewed-by: Alina Buzachis
SUMMARY
This PR refactors ec2_placement_group*.
Depends-On: ansible-collections/amazon.aws#2322
Refer: https://issues.redhat.com/browse/ACA-1886
ISSUE TYPE
COMPONENT NAME
ADDITIONAL INFORMATION