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

Improve iam_group exception handling #45599

Merged
merged 3 commits into from
Sep 17, 2018
Merged

Conversation

willthames
Copy link
Contributor

SUMMARY

Use AnsibleAWSModule for iam_group and handle BotoCoreErrors
as well as ClientErrors. Use fail_json_aws to improve error messages

Fixes #45593

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

iam_group

ANSIBLE VERSION
ansible 2.8.0.dev0 (devel 1463c2e4a8) last updated 2018/09/08 10:08:47 (GMT +1000)
  config file = None
  configured module search path = [u'/Users/will/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/will/src/ansible/lib/ansible
  executable location = /Users/will/src/ansible/bin/ansible
  python version = 2.7.14 (default, Mar  9 2018, 23:57:12) [GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)]
ADDITIONAL INFORMATION

Candidate for backport to all supported versions of ansible

Use AnsibleAWSModule for iam_group and handle BotoCoreErrors
as well as ClientErrors. Use fail_json_aws to improve error messages
@willthames
Copy link
Contributor Author

Unfortunately there is no test suite for iam_group, and I ran out of time to perform full testing on this change, so if anyone has a test suite to hand, I'd be grateful if they could run it in.

I started a test suite so I can always come back to that later.

@ansibot
Copy link
Contributor

ansibot commented Sep 13, 2018

cc @infectsoldier @naslanidis
click here for bot help

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud community_review In order to be merged, this PR must follow the community review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. owner_pr This PR is made by the module's maintainer. support:community This issue/PR relates to code supported by the Ansible community. labels Sep 13, 2018
@s-hertel s-hertel removed the needs_triage Needs a first human triage before being processed. label Sep 13, 2018
Copy link
Contributor

@s-hertel s-hertel left a comment

Choose a reason for hiding this comment

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

Would be nice to have tests but this looks all very straightforward.

Update some of the read-only IAM permissions (this is not sufficient
to run the test suite but it gets further than it did until it tries
to add a (non-existent) user)
@ansibot ansibot added core_review In order to be merged, this PR must follow the core review workflow. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests. and removed community_review In order to be merged, this PR must follow the community review workflow. owner_pr This PR is made by the module's maintainer. labels Sep 14, 2018
@willthames
Copy link
Contributor Author

@s-hertel I added a trivial test suite.

@s-hertel s-hertel merged commit d2569a3 into ansible:devel Sep 17, 2018
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 aws bug This issue/PR relates to a bug. cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. test This PR relates to tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MODULE_FAILURE: iam_group module fails when user doesn't exists
3 participants