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

AWS ELB: Return empty list when no load balancer name was found #215

Merged
merged 1 commit into from
Mar 14, 2021

Conversation

pjrm
Copy link
Contributor

@pjrm pjrm commented Aug 31, 2020

When trying to describe a LoadBalancer that doesn't exist, the module crash. Instead of that behavior, this commit will return an empty list when no load balancer is found, allowing to deal next tasks by reading the output of the module.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

plugins/modules/elb_classic_lb_info.py

@tremble
Copy link
Contributor

tremble commented Sep 11, 2020

Hi @pjrm thanks for taking the time to raise this PR. I'm not 100% on what behaviour we're want here so I'd like hear from at least @jillr, although as authors of this module @mjschultz and @nand0p could also chime in.

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution here.

In general I think this is the right change but we'd like a couple of extra pieces before we merge this.

  1. Please add a 'minor_changes' changelog entry: https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to
  2. We need at least some basic integration testing for the module
    • Please update the integration tests in tests/integration/targets/elb_classic_lb/tasks/main.yml to include at least some basic testing for this usecase and a minimal 'standard' use case.
    • Then add elb_classic_lb_info to tests/integration/targets/elb_classic_lb/aliases
    • While going the whole hog and adding elb_classic_lb_info calls and assertions after all/most elb_classic_lb calls would be nice, I appreciate that does take time and would be happy with just one for the 'an LB exists' use case and one for the 'no LBs exist' use case.

If you need any help getting these changes added you can find us on IRC (freenode: #ansible-aws) or just ask here.

@ansibullbot
Copy link

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR new_contributor Help guide this first time contributor plugins plugin (any type) labels Sep 22, 2020
@ansibullbot ansibullbot added the stale_ci CI is older than 7 days, rerun before merging label Nov 16, 2020
@tremble
Copy link
Contributor

tremble commented Feb 16, 2021

@pjrm

Hi, you tried to reach out on IRC but unfortunately I was in meetings. Feel free to ask your question on here or in #ansible-aws there's a couple of other folks who may also be able to help.

@ansibullbot ansibullbot removed the new_contributor Help guide this first time contributor label Feb 16, 2021
@ansibullbot
Copy link

@ansibullbot ansibullbot added integration tests/integration tests tests labels Feb 16, 2021
@pjrm
Copy link
Contributor Author

pjrm commented Feb 16, 2021

Hi @tremble,

Thank you very much for the feedback. I already provided the requested changes.

pjrm added a commit to pjrm/aws-terminator that referenced this pull request Feb 16, 2021
This permission is needed to use the classic elb_classic_info module on elb_classic integration tests (ansible-collections/community.aws#215).
@ansibullbot
Copy link

@pjrm this PR contains the following merge commits:

Please rebase your branch to remove these commits.

click here for bot help

@ansibullbot ansibullbot added merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Mar 14, 2021
@ansibullbot ansibullbot removed merge_commit This PR contains at least one merge commit. Please resolve! needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html labels Mar 14, 2021
When trying to describe a LoadBalancer that doesn't exist, the module crash. Instead of that behavior, this commit will return an empty list when no load balancer is found, allowing to deal next tasks by reading the output of the module.
@tremble tremble merged commit 3d5ffdc into ansible-collections:main Mar 14, 2021
@tremble
Copy link
Contributor

tremble commented Mar 14, 2021

Hi @pjrm thanks for your submission. Sorry it's taken so long to get this merged.

danquixote pushed a commit to danquixote/community.aws that referenced this pull request May 16, 2021
…ble-collections#215)

When trying to describe a LoadBalancer that doesn't exist, the module crash. Instead of that behavior, this commit will return an empty list when no load balancer is found, allowing to deal next tasks by reading the output of the module.

Co-authored-by: Pedro Magalhães <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…ble-collections#215)

When trying to describe a LoadBalancer that doesn't exist, the module crash. Instead of that behavior, this commit will return an empty list when no load balancer is found, allowing to deal next tasks by reading the output of the module.

Co-authored-by: Pedro Magalhães <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…ble-collections#215)

When trying to describe a LoadBalancer that doesn't exist, the module crash. Instead of that behavior, this commit will return an empty list when no load balancer is found, allowing to deal next tasks by reading the output of the module.

Co-authored-by: Pedro Magalhães <[email protected]>
danielcotton pushed a commit to danielcotton/community.aws that referenced this pull request Nov 23, 2021
…ble-collections#215)

When trying to describe a LoadBalancer that doesn't exist, the module crash. Instead of that behavior, this commit will return an empty list when no load balancer is found, allowing to deal next tasks by reading the output of the module.

Co-authored-by: Pedro Magalhães <[email protected]>
@pjrm pjrm deleted the aws_return_empty_list branch April 19, 2022 17:56
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
* ec2_vol support for gp3 volume

* fix sanity checks

* fix reference before assignment

* fix integration test

* None compare will alway result in True

* introduce new parameter 'modify_volume' to keep backwards compatibility

* fix output and expand integration test

* remove unused key

* fix integration test

* introduce throughput and fix ci

* try latest boto3

* rework boto3 requirements for integration test

* add botocode and coverage

* boto is also required

* add changelog fragment

* change version added

* change version to majo

* change description
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 bug This issue/PR relates to a bug integration tests/integration module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR plugins plugin (any type) stale_ci CI is older than 7 days, rerun before merging tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants