From 11ca16342c3eda10573b711b28e87ae8d40bd042 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nerijus=20Bali=C5=ABnas?= Date: Tue, 17 May 2022 16:32:01 +0300 Subject: [PATCH] Use absolute instead of relative imports (#809) Use absolute instead of relative imports This fixes mitogen-hq/mitogen#896. Although ansible without mitogen works without this PR, please consider accepting this PR, because some other files already have absolute imports, for example, ec2_instance.py, ec2_vpc_endpoint.py, etc. Reviewed-by: Mark Chappell Reviewed-by: Mark Woolley Reviewed-by: Markus Bergholz Reviewed-by: Alina Buzachis --- plugins/modules/aws_az_info.py | 6 ++--- plugins/modules/aws_caller_info.py | 4 ++-- plugins/modules/aws_s3.py | 24 +++++++++---------- plugins/modules/cloudformation.py | 10 ++++---- plugins/modules/cloudformation_info.py | 8 +++---- plugins/modules/ec2_ami.py | 16 ++++++------- plugins/modules/ec2_ami_info.py | 10 ++++---- plugins/modules/ec2_eni.py | 16 ++++++------- plugins/modules/ec2_eni_info.py | 10 ++++---- plugins/modules/ec2_group.py | 18 +++++++------- plugins/modules/ec2_group_info.py | 8 +++---- plugins/modules/ec2_key.py | 12 +++++----- plugins/modules/ec2_snapshot.py | 14 +++++------ plugins/modules/ec2_snapshot_info.py | 10 ++++---- plugins/modules/ec2_spot_instance.py | 10 ++++---- plugins/modules/ec2_tag.py | 10 ++++---- plugins/modules/ec2_tag_info.py | 4 ++-- plugins/modules/ec2_vol.py | 20 ++++++++-------- plugins/modules/ec2_vol_info.py | 8 +++---- plugins/modules/ec2_vpc_dhcp_option.py | 18 +++++++------- plugins/modules/ec2_vpc_dhcp_option_info.py | 10 ++++---- plugins/modules/ec2_vpc_igw.py | 14 +++++------ plugins/modules/ec2_vpc_nat_gateway.py | 16 ++++++------- plugins/modules/ec2_vpc_net.py | 16 ++++++------- plugins/modules/ec2_vpc_net_info.py | 10 ++++---- plugins/modules/ec2_vpc_subnet.py | 14 +++++------ plugins/modules/ec2_vpc_subnet_info.py | 8 +++---- plugins/modules/elb_classic_lb.py | 26 ++++++++++----------- plugins/modules/s3_bucket.py | 20 ++++++++-------- 29 files changed, 185 insertions(+), 185 deletions(-) diff --git a/plugins/modules/aws_az_info.py b/plugins/modules/aws_az_info.py index 1aef86f5cea..9f9d01ef5f3 100644 --- a/plugins/modules/aws_az_info.py +++ b/plugins/modules/aws_az_info.py @@ -73,9 +73,9 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list def main(): diff --git a/plugins/modules/aws_caller_info.py b/plugins/modules/aws_caller_info.py index 6f15d1f4714..d1f8f412d40 100644 --- a/plugins/modules/aws_caller_info.py +++ b/plugins/modules/aws_caller_info.py @@ -65,8 +65,8 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry def main(): diff --git a/plugins/modules/aws_s3.py b/plugins/modules/aws_s3.py index a17c3c3d44a..7aac4719767 100644 --- a/plugins/modules/aws_s3.py +++ b/plugins/modules/aws_s3.py @@ -375,18 +375,18 @@ from ansible.module_utils.basic import to_native from ansible.module_utils.six.moves.urllib.parse import urlparse -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.core import is_boto3_error_message -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import boto3_conn -from ..module_utils.ec2 import get_aws_connection_info -from ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.s3 import HAS_MD5 -from ..module_utils.s3 import calculate_etag -from ..module_utils.s3 import calculate_etag_content -from ..module_utils.s3 import validate_bucket_name +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_message +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_conn +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import get_aws_connection_info +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.s3 import HAS_MD5 +from ansible_collections.amazon.aws.plugins.module_utils.s3 import calculate_etag +from ansible_collections.amazon.aws.plugins.module_utils.s3 import calculate_etag_content +from ansible_collections.amazon.aws.plugins.module_utils.s3 import validate_bucket_name IGNORE_S3_DROP_IN_EXCEPTIONS = ['XNotImplemented', 'NotImplemented'] diff --git a/plugins/modules/cloudformation.py b/plugins/modules/cloudformation.py index f5266b3ae53..9177803d776 100644 --- a/plugins/modules/cloudformation.py +++ b/plugins/modules/cloudformation.py @@ -341,11 +341,11 @@ from ansible.module_utils._text import to_bytes from ansible.module_utils._text import to_native -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_message -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto_exception +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_message +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto_exception # Set a default, mostly for our integration tests. This will be overridden in # the main() loop to match the parameters we're passed diff --git a/plugins/modules/cloudformation_info.py b/plugins/modules/cloudformation_info.py index 8484228fff8..af22f0712b9 100644 --- a/plugins/modules/cloudformation_info.py +++ b/plugins/modules/cloudformation_info.py @@ -159,10 +159,10 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_message -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_message +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict class CloudFormationServiceManager: diff --git a/plugins/modules/ec2_ami.py b/plugins/modules/ec2_ami.py index c9685f03b96..c2a24746dd2 100644 --- a/plugins/modules/ec2_ami.py +++ b/plugins/modules/ec2_ami.py @@ -373,14 +373,14 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.ec2 import add_ec2_tags -from ..module_utils.tagging import boto3_tag_list_to_ansible_dict -from ..module_utils.tagging import boto3_tag_specifications -from ..module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import add_ec2_tags +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 def get_block_device_mapping(image): diff --git a/plugins/modules/ec2_ami_info.py b/plugins/modules/ec2_ami_info.py index 0c6371a646f..3e70d0ee05f 100644 --- a/plugins/modules/ec2_ami_info.py +++ b/plugins/modules/ec2_ami_info.py @@ -204,11 +204,11 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict def list_ec2_images(ec2_client, module): diff --git a/plugins/modules/ec2_eni.py b/plugins/modules/ec2_eni.py index 616b784224c..206533a3a53 100644 --- a/plugins/modules/ec2_eni.py +++ b/plugins/modules/ec2_eni.py @@ -301,14 +301,14 @@ except ImportError: pass # Handled by AnsibleAWSModule -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import get_ec2_security_group_ids_from_names -from ..module_utils.tagging import boto3_tag_list_to_ansible_dict -from ..module_utils.tagging import boto3_tag_specifications -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import get_ec2_security_group_ids_from_names +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.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter def get_eni_info(interface): diff --git a/plugins/modules/ec2_eni_info.py b/plugins/modules/ec2_eni_info.py index 900e6d13869..81f6ba82187 100644 --- a/plugins/modules/ec2_eni_info.py +++ b/plugins/modules/ec2_eni_info.py @@ -197,11 +197,11 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict def list_eni(connection, module): diff --git a/plugins/modules/ec2_group.py b/plugins/modules/ec2_group.py index d307df22a05..9954a449001 100644 --- a/plugins/modules/ec2_group.py +++ b/plugins/modules/ec2_group.py @@ -421,15 +421,15 @@ from ansible.module_utils.common.network import to_subnet from ansible.module_utils.six import string_types -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.ec2 import compare_aws_tags -from ..module_utils.iam import get_aws_account_id -from ..module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_aws_tags +from ansible_collections.amazon.aws.plugins.module_utils.iam import get_aws_account_id +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter Rule = namedtuple('Rule', ['port_range', 'protocol', 'target', 'target_type', 'description']) diff --git a/plugins/modules/ec2_group_info.py b/plugins/modules/ec2_group_info.py index ac81fa0372d..9b9aceeeaaf 100644 --- a/plugins/modules/ec2_group_info.py +++ b/plugins/modules/ec2_group_info.py @@ -96,10 +96,10 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict def main(): diff --git a/plugins/modules/ec2_key.py b/plugins/modules/ec2_key.py index da700b5f419..a0c8abd2e8e 100644 --- a/plugins/modules/ec2_key.py +++ b/plugins/modules/ec2_key.py @@ -177,12 +177,12 @@ from ansible.module_utils._text import to_bytes -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.tagging import boto3_tag_specifications -from ..module_utils.tagging import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +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 def extract_key_data(key, key_type=None): diff --git a/plugins/modules/ec2_snapshot.py b/plugins/modules/ec2_snapshot.py index 71c85933d75..08e0407a5b1 100644 --- a/plugins/modules/ec2_snapshot.py +++ b/plugins/modules/ec2_snapshot.py @@ -140,13 +140,13 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter def _get_most_recent_snapshot(snapshots, max_snapshot_age_secs=None, now=None): diff --git a/plugins/modules/ec2_snapshot_info.py b/plugins/modules/ec2_snapshot_info.py index aa60effb61f..227aec9c06b 100644 --- a/plugins/modules/ec2_snapshot_info.py +++ b/plugins/modules/ec2_snapshot_info.py @@ -211,11 +211,11 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict def list_ec2_snapshots(connection, module): diff --git a/plugins/modules/ec2_spot_instance.py b/plugins/modules/ec2_spot_instance.py index 33a6ce527f3..2ff3c36160e 100644 --- a/plugins/modules/ec2_spot_instance.py +++ b/plugins/modules/ec2_spot_instance.py @@ -406,13 +406,13 @@ import botocore except ImportError: pass # Handled by AnsibleAWSModule -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry 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 ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.core import is_boto3_error_code +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code def build_launch_specification(launch_spec): diff --git a/plugins/modules/ec2_tag.py b/plugins/modules/ec2_tag.py index ec2d7ab9c5a..59b02c818ac 100644 --- a/plugins/modules/ec2_tag.py +++ b/plugins/modules/ec2_tag.py @@ -113,11 +113,11 @@ type: dict ''' -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import compare_aws_tags -from ..module_utils.ec2 import describe_ec2_tags -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.ec2 import remove_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_aws_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import describe_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import remove_ec2_tags def main(): diff --git a/plugins/modules/ec2_tag_info.py b/plugins/modules/ec2_tag_info.py index 6d1e720c90f..77cb9ab08ef 100644 --- a/plugins/modules/ec2_tag_info.py +++ b/plugins/modules/ec2_tag_info.py @@ -51,8 +51,8 @@ type: dict ''' -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import describe_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import describe_ec2_tags def main(): diff --git a/plugins/modules/ec2_vol.py b/plugins/modules/ec2_vol.py index 43ee5661b91..9275288ffee 100644 --- a/plugins/modules/ec2_vol.py +++ b/plugins/modules/ec2_vol.py @@ -261,16 +261,16 @@ import time -from ..module_utils.arn import is_outpost_arn -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import camel_dict_to_snake_dict -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import describe_ec2_tags -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.ec2 import AWSRetry -from ..module_utils.core import is_boto3_error_code -from ..module_utils.tagging import boto3_tag_specifications +from ansible_collections.amazon.aws.plugins.module_utils.arn import is_outpost_arn +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import describe_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code +from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_specifications try: diff --git a/plugins/modules/ec2_vol_info.py b/plugins/modules/ec2_vol_info.py index 14b2e9f5bdc..43c76d984ed 100644 --- a/plugins/modules/ec2_vol_info.py +++ b/plugins/modules/ec2_vol_info.py @@ -133,10 +133,10 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict def get_volume_info(volume, region): diff --git a/plugins/modules/ec2_vpc_dhcp_option.py b/plugins/modules/ec2_vpc_dhcp_option.py index 889edca566d..b3b11427929 100644 --- a/plugins/modules/ec2_vpc_dhcp_option.py +++ b/plugins/modules/ec2_vpc_dhcp_option.py @@ -247,15 +247,15 @@ except ImportError: pass # Handled by AnsibleAWSModule -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import camel_dict_to_snake_dict -from ..module_utils.ec2 import normalize_ec2_vpc_dhcp_config -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.tagging import boto3_tag_specifications -from ..module_utils.tagging import ansible_dict_to_boto3_tag_list -from ..module_utils.tagging import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import normalize_ec2_vpc_dhcp_config +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_specifications +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 def fetch_dhcp_options_for_vpc(client, module, vpc_id): diff --git a/plugins/modules/ec2_vpc_dhcp_option_info.py b/plugins/modules/ec2_vpc_dhcp_option_info.py index 44a144065a6..c7cdaeefda3 100644 --- a/plugins/modules/ec2_vpc_dhcp_option_info.py +++ b/plugins/modules/ec2_vpc_dhcp_option_info.py @@ -146,11 +146,11 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.ec2 import normalize_ec2_vpc_dhcp_config +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import normalize_ec2_vpc_dhcp_config def get_dhcp_options_info(dhcp_option): diff --git a/plugins/modules/ec2_vpc_igw.py b/plugins/modules/ec2_vpc_igw.py index b59a1c2d68c..0d30b2d8f4f 100644 --- a/plugins/modules/ec2_vpc_igw.py +++ b/plugins/modules/ec2_vpc_igw.py @@ -103,13 +103,13 @@ except ImportError: pass # caught by AnsibleAWSModule -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.waiters import get_waiter -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import camel_dict_to_snake_dict -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.tagging import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict @AWSRetry.jittered_backoff(retries=10, delay=10) diff --git a/plugins/modules/ec2_vpc_nat_gateway.py b/plugins/modules/ec2_vpc_nat_gateway.py index 40d85f2a6cd..4f84ba6cf39 100644 --- a/plugins/modules/ec2_vpc_nat_gateway.py +++ b/plugins/modules/ec2_vpc_nat_gateway.py @@ -243,14 +243,14 @@ except ImportError: pass # Handled by AnsibleAWSModule -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.waiters import get_waiter -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import camel_dict_to_snake_dict -from ..module_utils.ec2 import describe_ec2_tags -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.tagging import boto3_tag_specifications +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import describe_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_specifications @AWSRetry.jittered_backoff(retries=10) diff --git a/plugins/modules/ec2_vpc_net.py b/plugins/modules/ec2_vpc_net.py index b0c611a467a..1f4d39fa779 100644 --- a/plugins/modules/ec2_vpc_net.py +++ b/plugins/modules/ec2_vpc_net.py @@ -204,14 +204,14 @@ from ansible.module_utils.common.network import to_subnet from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_message -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.ec2 import compare_aws_tags -from ..module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_message +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_aws_tags +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter def vpc_exists(module, vpc, name, cidr_block, multi): diff --git a/plugins/modules/ec2_vpc_net_info.py b/plugins/modules/ec2_vpc_net_info.py index 8f43a08d594..51f423a9586 100644 --- a/plugins/modules/ec2_vpc_net_info.py +++ b/plugins/modules/ec2_vpc_net_info.py @@ -161,11 +161,11 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict def describe_vpcs(connection, module): diff --git a/plugins/modules/ec2_vpc_subnet.py b/plugins/modules/ec2_vpc_subnet.py index 92c1523c885..494de08b159 100644 --- a/plugins/modules/ec2_vpc_subnet.py +++ b/plugins/modules/ec2_vpc_subnet.py @@ -218,13 +218,13 @@ from ansible.module_utils._text import to_text from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.ec2 import ensure_ec2_tags -from ..module_utils.arn import is_outpost_arn -from ..module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags +from ansible_collections.amazon.aws.plugins.module_utils.arn import is_outpost_arn +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter def get_subnet_info(subnet): diff --git a/plugins/modules/ec2_vpc_subnet_info.py b/plugins/modules/ec2_vpc_subnet_info.py index 3741a227b5a..c5135efa422 100644 --- a/plugins/modules/ec2_vpc_subnet_info.py +++ b/plugins/modules/ec2_vpc_subnet_info.py @@ -151,10 +151,10 @@ from ansible.module_utils.common.dict_transformations import camel_dict_to_snake_dict -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict @AWSRetry.exponential_backoff() diff --git a/plugins/modules/elb_classic_lb.py b/plugins/modules/elb_classic_lb.py index 2d7913ac044..6b32c092a5f 100644 --- a/plugins/modules/elb_classic_lb.py +++ b/plugins/modules/elb_classic_lb.py @@ -686,19 +686,19 @@ except ImportError: pass # Taken care of by AnsibleAWSModule -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.core import scrub_none_parameters -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_filter_list -from ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.ec2 import camel_dict_to_snake_dict -from ..module_utils.ec2 import compare_aws_tags -from ..module_utils.ec2 import snake_dict_to_camel_dict - -from ..module_utils.ec2 import get_ec2_security_group_ids_from_names -from ..module_utils.waiters import get_waiter +from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule +from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code +from ansible_collections.amazon.aws.plugins.module_utils.core import scrub_none_parameters +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_filter_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_aws_tags +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import snake_dict_to_camel_dict + +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import get_ec2_security_group_ids_from_names +from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter class ElbManager(object): diff --git a/plugins/modules/s3_bucket.py b/plugins/modules/s3_bucket.py index 7d115d56647..f26b5f2d830 100644 --- a/plugins/modules/s3_bucket.py +++ b/plugins/modules/s3_bucket.py @@ -345,16 +345,16 @@ from ansible.module_utils.six import string_types from ansible.module_utils.six.moves.urllib.parse import urlparse -from ..module_utils.core import AnsibleAWSModule -from ..module_utils.core import is_boto3_error_code -from ..module_utils.ec2 import AWSRetry -from ..module_utils.ec2 import ansible_dict_to_boto3_tag_list -from ..module_utils.ec2 import boto3_conn -from ..module_utils.ec2 import boto3_tag_list_to_ansible_dict -from ..module_utils.ec2 import compare_policies -from ..module_utils.ec2 import get_aws_connection_info -from ..module_utils.ec2 import snake_dict_to_camel_dict -from ..module_utils.s3 import validate_bucket_name +from ansible_collections.amazon.aws.plugins.module_utils.core import 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 +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_conn +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_policies +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import get_aws_connection_info +from ansible_collections.amazon.aws.plugins.module_utils.ec2 import snake_dict_to_camel_dict +from ansible_collections.amazon.aws.plugins.module_utils.s3 import validate_bucket_name def create_or_update_bucket(s3_client, module, location):