Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move module_utils out of subdir #23

Merged
merged 1 commit into from
Jun 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions plugins/modules/aws_acm.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
'''


from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.aws.acm import ACMServiceManager
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.acm import ACMServiceManager
from ansible.module_utils._text import to_text
import base64
import re # regex library
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/aws_acm_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,8 @@
type: str
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.aws.acm import ACMServiceManager
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.acm import ACMServiceManager


def main():
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_api_gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@
pass

import traceback
from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import (AWSRetry, camel_dict_to_snake_dict)


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_application_scaling_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@
sample: '2017-09-28T08:22:51.881000-03:00'
''' # NOQA

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import _camel_to_snake, camel_dict_to_snake_dict

try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_batch_compute_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
type: dict
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import snake_dict_to_camel_dict, camel_dict_to_snake_dict
import re

Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/aws_batch_job_definition.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@
type: dict
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.batch import cc, set_api_params
from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.batch import cc, set_api_params
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

try:
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/aws_batch_job_queue.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@
type: dict
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.batch import set_api_params
from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.batch import set_api_params
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

try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_codebuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@
sample: "2018-04-17T16:56:03.245000+02:00"
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, get_boto3_client_method_parameters
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, get_boto3_client_method_parameters
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict, snake_dict_to_camel_dict


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

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_codepipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@
import traceback

from ansible.module_utils._text import to_native
from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict, compare_policies


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_config_aggregation_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
except ImportError:
pass # handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_config_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
except ImportError:
pass # handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry, camel_dict_to_snake_dict


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_config_delivery_channel.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
except ImportError:
pass # handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict, AWSRetry


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_config_recorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
except ImportError:
pass # handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict, AWSRetry


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_config_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
except ImportError:
pass # handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry, camel_dict_to_snake_dict


Expand Down
13 changes: 7 additions & 6 deletions plugins/modules/aws_direct_connect_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,13 +154,14 @@
"""

import traceback
from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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, AWSRetry)
from ansible_collections.amazon.aws.plugins.module_utils.aws.direct_connect import (DirectConnectError,
delete_connection,
associate_connection_and_lag,
disassociate_connection_and_lag,
)
from ansible_collections.amazon.aws.plugins.module_utils.direct_connect import (
DirectConnectError,
delete_connection,
associate_connection_and_lag,
disassociate_connection_and_lag,
)

try:
from botocore.exceptions import BotoCoreError, ClientError
Expand Down
26 changes: 14 additions & 12 deletions plugins/modules/aws_direct_connect_link_aggregation_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,19 +160,21 @@
returned: when I(state=present)
"""

from ansible_collections.amazon.aws.plugins.module_utils.ec2 import (camel_dict_to_snake_dict,
ec2_argument_spec,
HAS_BOTO3,
get_aws_connection_info,
boto3_conn,
AWSRetry,
)
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import (
AWSRetry,
HAS_BOTO3,
boto3_conn,
camel_dict_to_snake_dict,
ec2_argument_spec,
get_aws_connection_info,
)
from ansible.module_utils.basic import AnsibleModule
from ansible_collections.amazon.aws.plugins.module_utils.aws.direct_connect import (DirectConnectError,
delete_connection,
delete_virtual_interface,
disassociate_connection_and_lag,
)
from ansible_collections.amazon.aws.plugins.module_utils.direct_connect import (
DirectConnectError,
delete_connection,
delete_virtual_interface,
disassociate_connection_and_lag,
)
import traceback
import time

Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/aws_direct_connect_virtual_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,8 @@
'''

import traceback
from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.aws.direct_connect import DirectConnectError, delete_virtual_interface
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.direct_connect import DirectConnectError, delete_virtual_interface
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry, camel_dict_to_snake_dict

try:
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/aws_eks_cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@
'''


from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict, get_ec2_security_group_ids_from_names
from ansible_collections.amazon.aws.plugins.module_utils.aws.waiters import get_waiter
from ansible_collections.amazon.aws.plugins.module_utils.waiters import get_waiter

try:
import botocore.exceptions
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_elasticbeanstalk_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
except ImportError:
pass # handled by AnsibleAWSModule

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


def describe_app(ebs, app_name, module):
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_glue_connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
sample: {'subnet-id':'subnet-aabbccddee'}
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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, get_ec2_security_group_ids_from_names

# Non-ansible imports
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_glue_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@
sample: 300
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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

# Non-ansible imports
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_inspector_target.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
sample: "2018-01-29T13:48:51.958000+00:00"
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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_tag_list,
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_kms.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
'admin': 'Allow access for Key Administrators'
}

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule, is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry, camel_dict_to_snake_dict
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict, ansible_dict_to_boto3_tag_list
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_aws_tags, compare_policies
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_region_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
}]"
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry, ansible_dict_to_boto3_filter_list, camel_dict_to_snake_dict

try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_s3_cors.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
except Exception:
pass # Handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import snake_dict_to_camel_dict, compare_policies


Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_secret.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@
'''

from ansible.module_utils._text import to_bytes
from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import snake_dict_to_camel_dict, camel_dict_to_snake_dict
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict, compare_aws_tags, ansible_dict_to_boto3_tag_list

Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_ses_identity.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@
type: bool
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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, AWSRetry, get_aws_connection_info

import time
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_ses_identity_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
sample: [ExamplePolicy]
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import compare_policies, AWSRetry

import json
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_ses_rule_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
}]
"""

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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, AWSRetry

try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_sgw_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
region: eu-west-3
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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

try:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_ssm_parameter_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
type: dict
'''

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

try:
from botocore.exceptions import ClientError
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/aws_step_functions_state_machine.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@
returned: always
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import (ansible_dict_to_boto3_tag_list,
AWSRetry,
compare_aws_tags,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
'''


from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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

try:
Expand Down
6 changes: 3 additions & 3 deletions plugins/modules/aws_waf_condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,10 @@
except ImportError:
pass # handled by AnsibleAWSModule

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
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, AWSRetry, compare_policies
from ansible_collections.amazon.aws.plugins.module_utils.aws.waf import run_func_with_change_token_backoff, MATCH_LOOKUP
from ansible_collections.amazon.aws.plugins.module_utils.aws.waf import get_rule_with_backoff, list_rules_with_backoff, list_regional_rules_with_backoff
from ansible_collections.amazon.aws.plugins.module_utils.waf import run_func_with_change_token_backoff, MATCH_LOOKUP
from ansible_collections.amazon.aws.plugins.module_utils.waf import get_rule_with_backoff, list_rules_with_backoff, list_regional_rules_with_backoff


class Condition(object):
Expand Down
4 changes: 2 additions & 2 deletions plugins/modules/aws_waf_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@
]
'''

from ansible_collections.amazon.aws.plugins.module_utils.aws.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.aws.waf import list_web_acls, get_web_acl
from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.waf import list_web_acls, get_web_acl


def main():
Expand Down
Loading