From a4552c11b3dbb5f8a330c714e3f9c2a8419cb363 Mon Sep 17 00:00:00 2001 From: Sloane Hertel Date: Fri, 17 Mar 2017 16:11:48 -0400 Subject: [PATCH] allow groups parameter to be noticed as an empty list (#22707) make iam.py pep8 remove iam.py from pep8 legacy files --- lib/ansible/modules/cloud/amazon/iam.py | 8 +++++--- test/sanity/pep8/legacy-files.txt | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/lib/ansible/modules/cloud/amazon/iam.py b/lib/ansible/modules/cloud/amazon/iam.py index 9da0575df9..050764b056 100644 --- a/lib/ansible/modules/cloud/amazon/iam.py +++ b/lib/ansible/modules/cloud/amazon/iam.py @@ -55,7 +55,8 @@ options: choices: [ "present", "absent", "update" ] path: description: - - When creating or updating, specify the desired path of the resource. If state is present, it will replace the current path to match what is passed in when they do not match. + - When creating or updating, specify the desired path of the resource. If state is present, + it will replace the current path to match what is passed in when they do not match. required: false default: "/" trust_policy: @@ -101,7 +102,8 @@ options: description: - C(always) will update passwords if they differ. C(on_create) will only set the password for newly created users. notes: - - 'Currently boto does not support the removal of Managed Policies, the module will error out if your user/group/role has managed policies when you try to do state=absent. They will need to be removed manually.' + - 'Currently boto does not support the removal of Managed Policies, the module will error out if your + user/group/role has managed policies when you try to do state=absent. They will need to be removed manually.' author: - "Jonathan I. Davila (@defionscode)" - "Paul Seiffert (@seiffert)" @@ -701,7 +703,7 @@ def main(): if name_change and new_name: orig_name = name name = new_name - if groups: + if isinstance(groups, list): user_groups, groups_changed = set_users_groups( module, iam, name, groups, been_updated, new_name) if groups_changed == user_changed: diff --git a/test/sanity/pep8/legacy-files.txt b/test/sanity/pep8/legacy-files.txt index 1802d6a6ff..2ae0a1a68d 100644 --- a/test/sanity/pep8/legacy-files.txt +++ b/test/sanity/pep8/legacy-files.txt @@ -47,7 +47,6 @@ lib/ansible/modules/cloud/amazon/ecs_service.py lib/ansible/modules/cloud/amazon/ecs_service_facts.py lib/ansible/modules/cloud/amazon/ecs_taskdefinition.py lib/ansible/modules/cloud/amazon/elasticache.py -lib/ansible/modules/cloud/amazon/iam.py lib/ansible/modules/cloud/amazon/iam_cert.py lib/ansible/modules/cloud/amazon/iam_policy.py lib/ansible/modules/cloud/amazon/iam_role.py