Skip to content

Commit

Permalink
Bulk migration to AnsibleAWSModule (ansible-collections#173)
Browse files Browse the repository at this point in the history
* Update comments to reference AnsibleAWSModule rather than AnsibleModule
* Bulk re-order imports and split onto one from import per-line.
* Add AnsibleAWSModule imports
* Migrate boto 2 based modules to AnsibleAWSModule
* Move boto3-only modules over to AnsibleAWSModule
* Remove extra ec2_argument_spec calls - not needed now we're using AnsibleAWSModule
* Remove most HAS_BOTO3 code, it's handled by AnsibleAWSModule
* Handle missing Boto 2 consistently  (HAS_BOTO)
* Remove AnsibleModule imports
* Changelog fragment

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@818c6d2
  • Loading branch information
tremble authored and goneri committed Sep 21, 2022
1 parent 52840d2 commit 6f58659
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions plugins/modules/ec2_eip.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,10 @@
except ImportError:
pass # caught by AnsibleAWSModule

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, 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.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


def associate_ip_and_device(ec2, module, address, private_ip_address, device_id, allow_reassociation, check_mode, is_instance=True):
Expand Down Expand Up @@ -499,7 +501,7 @@ def allocate_address_from_pool(ec2, module, domain, check_mode, public_ipv4_pool


def generate_tag_dict(module, tag_name, tag_value):
# type: (AnsibleModule, str, str) -> Optional[Dict]
# type: (AnsibleAWSModule, str, str) -> Optional[Dict]
""" Generates a dictionary to be passed as a filter to Amazon """
if tag_name and not tag_value:
if tag_name.startswith('tag:'):
Expand Down

0 comments on commit 6f58659

Please sign in to comment.