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@a4f20bf
  • Loading branch information
tremble authored and alinabuzachis committed Oct 9, 2023
1 parent 6ffaed0 commit 6e9df2f
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions plugins/modules/iam_password_policy.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
#!/usr/bin/python
# -*- coding: utf-8 -*-

# Copyright: (c) 2018, Aaron Smith <ajsmith10381@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from __future__ import absolute_import, division, print_function
__metaclass__ = type


DOCUMENTATION = '''
DOCUMENTATION = r"""
---
module: iam_password_policy
version_added: 1.0.0
short_description: Update an IAM Password Policy
description:
- Module updates an IAM Password Policy on a given AWS account
- Module updates an IAM Password Policy on a given AWS account
author:
- "Aaron Smith (@slapula)"
- "Aaron Smith (@slapula)"
options:
state:
description:
Expand Down Expand Up @@ -75,13 +72,12 @@
type: bool
aliases: [password_expire, expire]
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.boto3
- amazon.aws.common.modules
- amazon.aws.region.modules
- amazon.aws.boto3
"""

'''

EXAMPLES = '''
EXAMPLES = r"""
- name: Password policy for AWS account
community.aws.iam_password_policy:
state: present
Expand All @@ -94,9 +90,9 @@
pw_max_age: 60
pw_reuse_prevent: 5
pw_expire: false
'''
"""

RETURN = ''' # '''
RETURN = r""" # """

try:
import botocore
Expand All @@ -105,8 +101,9 @@

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.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code


class IAMConnection(object):
Expand Down

0 comments on commit 6e9df2f

Please sign in to comment.