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

Make iam module more predictable and idempotent … #369

Merged

Conversation

stefanhorning
Copy link
Contributor

…on returning the user_name it creates/deletes

SUMMARY

Currently dependending on what the module does (create/update/delete) one has to find the returned user_name in different places (or it won't be returned at all). To make this behaviour more consistent, this patch makes sure that the user name is always returned under the user_name key.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

iam.py

ADDITIONAL INFORMATION

I have gist here with a playbook showcasing the issue: https://gist.github.com/stefanhorning/a948b9f63a5db8a2a38fc988080a13b2

Run it without my patch and you will get arbitrary output (defined/undefined) for the user_name param. Run it with my patch and it will behave predictably and consistent.

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module needs_triage plugins plugin (any type) labels Jan 22, 2021
@gravesm
Copy link
Member

gravesm commented Mar 19, 2021

@stefanhorning thank you for the PR. Could you add changelog fragment?

@stefanhorning
Copy link
Contributor Author

@gravesm done.

@gravesm gravesm requested review from jillr and tremble March 22, 2021 13:05
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.

The PR/Issue should be linked to in the changelog fragment, this helps folks digging into changes that might have introduced bugs or behaviour changes.

I would generally say that idempotency is more about a lack of "changed" (and not actually making a change) rather than a different return value.

changelogs/fragments/369-iam-return-values.yml Outdated Show resolved Hide resolved
@tremble
Copy link
Contributor

tremble commented Mar 24, 2021

Thanks for your PR. I'm sorry it's taking so long to get through these reviews. Just a minor niggle

@ansibullbot ansibullbot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed community_review labels Mar 24, 2021
@stefanhorning
Copy link
Contributor Author

@tremble done

@tremble tremble merged commit cc62c71 into ansible-collections:main Mar 24, 2021
@tremble
Copy link
Contributor

tremble commented Mar 24, 2021

Thanks @stefanhorning

alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…s#369)

* Make iam module more predictable and idempotent on returning the user_name it creates/deletes
* Add changelog fragment for iam module change
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…s#369)

* Make iam module more predictable and idempotent on returning the user_name it creates/deletes
* Add changelog fragment for iam module change
danielcotton pushed a commit to danielcotton/community.aws that referenced this pull request Nov 23, 2021
…s#369)

* Make iam module more predictable and idempotent on returning the user_name it creates/deletes
* Add changelog fragment for iam module change
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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 plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants