Skip to content

Commit

Permalink
Cleanup headers and imports (ansible-collections#1738)
Browse files Browse the repository at this point in the history
Cleanup headers and imports

SUMMARY
Mass update of imports, docs fragments and file headers

Many of the amazon.aws module_utils and docs fragments got moved about, update community.aws to reflect this.
Consistently apply the comment headers as documented at https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html#python-shebang-utf-8-coding

ISSUE TYPE

Docs Pull Request
Feature Pull Request

COMPONENT NAME
ADDITIONAL INFORMATION
Header cleanup based upon:
https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html#python-shebang-utf-8-coding

Begin your Ansible module with #!/usr/bin/python - this “shebang” allows ansible_python_interpreter to work. Follow the shebang immediately with # -*- coding: utf-8 -*- to clarify that the file is UTF-8 encoded.

and
https://docs.ansible.com/ansible/devel/dev_guide/developing_modules_documenting.html#copyright-and-license

After the shebang and UTF-8 coding, add a copyright line with the original copyright holder and a license declaration. The license declaration should be ONLY one line, not the full GPL prefix.
...
Additions to the module (for instance, rewrites) are not permitted to add additional copyright lines other than the default copyright statement if missing:

Reviewed-by: Alina Buzachis

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@a4f20bf
  • Loading branch information
tremble authored and alinabuzachis committed Oct 6, 2023
1 parent 05879ae commit 16176ea
Showing 1 changed file with 19 additions and 32 deletions.
51 changes: 19 additions & 32 deletions plugins/modules/iam_group.py
Original file line number Diff line number Diff line change
@@ -1,33 +1,19 @@
#!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Ansible. If not, see <http://www.gnu.org/licenses/>.

from __future__ import absolute_import, division, print_function
__metaclass__ = type


DOCUMENTATION = r'''
# -*- coding: utf-8 -*-

# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

DOCUMENTATION = r"""
---
module: iam_group
version_added: 1.0.0
short_description: Manage AWS IAM groups
description:
- Manage AWS IAM groups.
author:
- Nick Aslanidis (@naslanidis)
- Maksym Postument (@infectsoldier)
- Nick Aslanidis (@naslanidis)
- Maksym Postument (@infectsoldier)
options:
name:
description:
Expand Down Expand Up @@ -70,12 +56,12 @@
default: false
type: bool
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.boto3
'''
- amazon.aws.common.modules
- amazon.aws.region.modules
- amazon.aws.boto3
"""

EXAMPLES = r'''
EXAMPLES = r"""
# Note: These examples do not set authentication details, see the AWS Guide for details.
- name: Create a group
Expand Down Expand Up @@ -119,8 +105,8 @@
name: testgroup1
state: absent
'''
RETURN = r'''
"""
RETURN = r"""
iam_group:
description: dictionary containing all the group information including group membership
returned: success
Expand Down Expand Up @@ -176,7 +162,7 @@
description: the path to the user
type: str
sample: /
'''
"""

try:
import botocore
Expand All @@ -185,9 +171,10 @@

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict

from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry


def compare_attached_group_policies(current_attached_policies, new_attached_policies):
Expand Down

0 comments on commit 16176ea

Please sign in to comment.