Skip to content

Commit

Permalink
Apply formatters
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Sep 30, 2023
1 parent 30711ae commit e7674d1
Show file tree
Hide file tree
Showing 74 changed files with 185 additions and 152 deletions.
10 changes: 6 additions & 4 deletions plugins/connection/aws_ssm.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@
state: present
"""

import os
import getpass
import json
import os
import pty
import random
import re
Expand All @@ -280,18 +280,20 @@
pass

from functools import wraps
from ansible_collections.amazon.aws.plugins.module_utils.botocore import HAS_BOTO3

from ansible.errors import AnsibleConnectionFailure
from ansible.errors import AnsibleError
from ansible.errors import AnsibleFileNotFound
from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.six.moves import xrange
from ansible.module_utils._text import to_bytes
from ansible.module_utils._text import to_text
from ansible.module_utils.basic import missing_required_lib
from ansible.module_utils.six.moves import xrange
from ansible.plugins.connection import ConnectionBase
from ansible.plugins.shell.powershell import _common_args
from ansible.utils.display import Display

from ansible_collections.amazon.aws.plugins.module_utils.botocore import HAS_BOTO3

display = Display()


Expand Down
3 changes: 2 additions & 1 deletion plugins/module_utils/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.common import set_collection_info
from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule

from ansible_collections.community.aws.plugins.module_utils.common import COMMUNITY_AWS_COLLECTION_NAME
from ansible_collections.community.aws.plugins.module_utils.common import COMMUNITY_AWS_COLLECTION_VERSION

Expand Down
7 changes: 3 additions & 4 deletions plugins/module_utils/networkfirewall.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
# Copyright: Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from copy import deepcopy
import time
from copy import deepcopy

from ansible.module_utils._text import to_text
from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict
Expand All @@ -13,14 +13,13 @@
from ansible_collections.amazon.aws.plugins.module_utils.arn import parse_aws_arn
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.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import ansible_dict_to_boto3_tag_list
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import compare_aws_tags

from ansible_collections.community.aws.plugins.module_utils.base import Boto3Mixin
from ansible_collections.community.aws.plugins.module_utils.base import BaseResourceManager
from ansible_collections.community.aws.plugins.module_utils.base import BaseWaiterFactory

from ansible_collections.community.aws.plugins.module_utils.base import Boto3Mixin
from ansible_collections.community.aws.plugins.module_utils.ec2 import BaseEc2Manager


Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/opensearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
# Copyright: Contributors to the Ansible project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)

from copy import deepcopy
import datetime
import functools
import time
from copy import deepcopy

try:
import botocore
Expand Down
2 changes: 1 addition & 1 deletion plugins/module_utils/sns.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,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)

import re
import copy
import re

try:
import botocore
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/acm_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@


import base64
from copy import deepcopy
import re # regex library
from copy import deepcopy

try:
import botocore
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/api_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@

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.amazon.aws.plugins.module_utils.tagging import compare_aws_tags

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.tagging import compare_aws_tags


def main():
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/application_autoscaling_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,8 @@
except ImportError:
pass # handled by AnsibleAWSModule

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict
from ansible.module_utils.common.dict_transformations import _camel_to_snake
from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/batch_compute_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict

from ansible_collections.amazon.aws.plugins.module_utils.arn import validate_aws_arn
from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

# ---------------------------------------------------------------------------------------------------
#
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/batch_job_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


# ---------------------------------------------------------------------------------------------------
#
# Helper Functions & classes
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/cloudformation_exports_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
"""

try:
from botocore.exceptions import ClientError
from botocore.exceptions import BotoCoreError
from botocore.exceptions import ClientError
except ImportError:
pass # handled by AnsibleAWSModule

Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/cloudfront_distribution.py
Original file line number Diff line number Diff line change
Expand Up @@ -1415,9 +1415,9 @@
sample: abcd1234-1234-abcd-abcd-abcd12345678
"""

from collections import OrderedDict
import datetime
import re
from collections import OrderedDict

try:
import botocore
Expand All @@ -1426,8 +1426,8 @@

from ansible.module_utils._text import to_native
from ansible.module_utils._text import to_text
from ansible.module_utils.common.dict_transformations import recursive_diff
from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict
from ansible.module_utils.common.dict_transformations import recursive_diff
from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict

from ansible_collections.amazon.aws.plugins.module_utils.cloudfront_facts import CloudFrontFactsServiceManager
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/config_delivery_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


# this waits for an IAM role to become fully available, at the cost of
# taking a long time to fail when the IAM role/policy really is invalid
retry_unavailable_iam_on_put_delivery = AWSRetry.jittered_backoff(
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/data_pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


DP_ACTIVE_STATES = ["ACTIVE", "SCHEDULED"]
DP_INACTIVE_STATES = ["INACTIVE", "PENDING", "FINISHED", "DELETING"]
DP_ACTIVATING_STATE = "ACTIVATING"
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/directconnect_confirm_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


retry_params = {"retries": 10, "delay": 5, "backoff": 1.2, "catch_extra_error_codes": ["DirectConnectClientException"]}


Expand Down
1 change: 0 additions & 1 deletion plugins/modules/directconnect_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


retry_params = {"retries": 10, "delay": 5, "backoff": 1.2, "catch_extra_error_codes": ["DirectConnectClientException"]}


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/directconnect_link_aggregation_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@
returned: when I(state=present)
"""

import traceback
import time
import traceback

try:
import botocore
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/dms_endpoint.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


backoff_params = dict(retries=5, delay=1, backoff=1.5)


Expand Down
1 change: 0 additions & 1 deletion plugins/modules/dms_replication_subnet_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


backoff_params = dict(retries=5, delay=1, backoff=1.5)


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_carrier_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,8 @@
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_message
from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags
from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.transformation import ansible_dict_to_boto3_filter_list

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_customer_gateway_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict

from ansible_collections.amazon.aws.plugins.module_utils.transformation import ansible_dict_to_boto3_filter_list
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.transformation import ansible_dict_to_boto3_filter_list

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

Expand Down
1 change: 0 additions & 1 deletion plugins/modules/ec2_vpc_nacl.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


# VPC-supported IANA protocol numbers
# http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
PROTOCOL_NUMBERS = {"all": -1, "icmp": 1, "tcp": 6, "udp": 17, "ipv6-icmp": 58}
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/ec2_vpc_nacl_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


# VPC-supported IANA protocol numbers
# http://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml
PROTOCOL_NAMES = {"-1": "all", "1": "icmp", "6": "tcp", "17": "udp"}
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_peering_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,8 @@

from ansible_collections.amazon.aws.plugins.module_utils.botocore import normalize_boto3_result
from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry
from ansible_collections.amazon.aws.plugins.module_utils.transformation import ansible_dict_to_boto3_filter_list
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.transformation import ansible_dict_to_boto3_filter_list

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_vgw.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,8 @@
from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags
from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_specifications
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_specifications
from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_vpc_vpn_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict

from ansible_collections.amazon.aws.plugins.module_utils.transformation import ansible_dict_to_boto3_filter_list
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.transformation import ansible_dict_to_boto3_filter_list

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ecs_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,8 @@
except ImportError:
pass # Handled by AnsibleAWSModule

from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict
from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict
from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ecs_ecr.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
from ansible.module_utils.common.dict_transformations import snake_dict_to_camel_dict
from ansible.module_utils.six import string_types

from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.botocore import boto_exception
from ansible_collections.amazon.aws.plugins.module_utils.botocore import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.policy import compare_policies

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule
Expand Down
1 change: 0 additions & 1 deletion plugins/modules/ecs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -695,7 +695,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


DEPLOYMENT_CONTROLLER_TYPE_MAP = {
"type": "str",
}
Expand Down
3 changes: 1 addition & 2 deletions plugins/modules/efs_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,12 @@
pass

from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import ansible_dict_to_boto3_tag_list
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import compare_aws_tags

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


MAX_AWS_RETRIES = 10 # How many retries to perform when an API call is failing
WAIT_RETRY = 5 # how many seconds to wait between propagation status polls

Expand Down
1 change: 0 additions & 1 deletion plugins/modules/elb_classic_lb_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule


MAX_AWS_RETRIES = 5
MAX_AWS_DELAY = 5

Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/elb_network_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -329,11 +329,11 @@

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict

from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import compare_aws_tags
from ansible_collections.amazon.aws.plugins.module_utils.elbv2 import ELBListener
from ansible_collections.amazon.aws.plugins.module_utils.elbv2 import ELBListeners
from ansible_collections.amazon.aws.plugins.module_utils.elbv2 import NetworkLoadBalancer
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import compare_aws_tags

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/mq_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@
pass

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict
from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule

PARAMS_MAP = {
"authentication_strategy": "AuthenticationStrategy",
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/mq_broker_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@
pass

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict
from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule

DEFAULTS = {"reboot": False}
FULL_DEBUG = False
Expand Down
1 change: 1 addition & 0 deletions plugins/modules/mq_broker_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
pass

from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict

from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule


Expand Down
Loading

0 comments on commit e7674d1

Please sign in to comment.