Skip to content

Commit

Permalink
[Breaking Change] Final removal of original boto SDK (#898)
Browse files Browse the repository at this point in the history
[Breaking Change] Final removal of original boto SDK

SUMMARY

Remove old boto based inventory script
Clean up requirements
Clean up random comments in docs/comments

ISSUE TYPE

Feature Pull Request

COMPONENT NAME
scripts/inventory/ec2.py
requirements.txt
test-requirements.txt
tests/integration/requirements.txt
tests/unit/requirements.txt
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
  • Loading branch information
tremble authored Jan 31, 2022
1 parent 3f7d4a0 commit 00037be
Show file tree
Hide file tree
Showing 20 changed files with 13 additions and 2,158 deletions.
6 changes: 6 additions & 0 deletions changelogs/fragments/898-boto-removal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
breaking_changes:
- script_inventory_ec2 - The ec2.py inventory script has been moved to a new repository.
The script can now be downloaded from https://github.com/ansible-community/contrib-scripts/blob/main/inventory/ec2.py and has been removed from this collection.
We recommend migrating from the script to the amazon.aws.ec2 inventory plugin. (https://github.com/ansible-collections/community.aws/pull/898)
- community.aws collection - The ``community.aws`` collection has now dropped support for and any requirements upon the original ``boto`` AWS SDK, and now uses the ``boto3``/``botocore`` AWS SDK
(https://github.com/ansible-collections/community.aws/pull/898).
2 changes: 1 addition & 1 deletion plugins/modules/aws_direct_connect_virtual_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ def create_vi(client, public, associated_id, creation_params):
:param public: a boolean
:param associated_id: a link aggregation group ID or connection ID to associate
with the virtual interface.
:param creation_params: a dict of parameters to use in the boto call
:param creation_params: a dict of parameters to use in the AWS SDK call
:return The ID of the created virtual interface
'''
err_msg = "Failed to create virtual interface"
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ec2_eip.py
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ def ensure_absent(ec2, module, address, device_id, check_mode, is_instance=True)

def allocate_address_from_pool(ec2, module, domain, check_mode, public_ipv4_pool):
# type: (EC2Connection, str, bool, str) -> Address
""" Overrides boto's allocate_address function to support BYOIP """
""" Overrides botocore's allocate_address function to support BYOIP """
params = {}

if domain is not None:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ecs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ def main():
loadBalancer['containerPort'] = int(loadBalancer['containerPort'])

if update:
# check various parameters and boto versions and give a helpful error in boto is not new enough for feature
# check various parameters and AWS SDK versions and give a helpful error if the SDK is not new enough for feature

if module.params['scheduling_strategy']:
if (existing['schedulingStrategy']) != module.params['scheduling_strategy']:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/ecs_taskdefinition.py
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,7 @@ def register_task(self, family, task_role_arn, execution_role_arn, network_mode,
volumes, launch_type, cpu, memory, placement_constraints):
validated_containers = []

# Ensures the number parameters are int as required by boto
# Ensures the number parameters are int as required by the AWS SDK
for container in container_definitions:
for param in ('memory', 'cpu', 'memoryReservation', 'startTimeout', 'stopTimeout'):
if param in container:
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/iam_saml_federation.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def __init__(self, module):
try:
self.conn = module.client('iam')
except botocore.exceptions.ClientError as e:
self.module.fail_json_aws(e, msg="Unknown boto error")
self.module.fail_json_aws(e, msg="Unknown AWS SDK error")

# use retry decorator for boto3 calls
@AWSRetry.jittered_backoff(retries=3, delay=5)
Expand Down
2 changes: 0 additions & 2 deletions plugins/modules/iam_server_certificate.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
requirements:
- boto >= 2.49.0
'''

EXAMPLES = '''
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/rds_param_group.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ def convert_parameter(param, value):
converted_value = int(value[:-1]) * INT_MODIFIERS[modifier]
except ValueError:
# may be based on a variable (ie. {foo*3/4}) so
# just pass it on through to boto
# just pass it on through to the AWS SDK
pass
elif isinstance(value, bool):
converted_value = 1 if value else 0
Expand Down
2 changes: 1 addition & 1 deletion plugins/modules/route53.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,7 @@ def get_zone_id_by_name(route53, module, zone_name, want_private, want_vpc_id):

if private_zone == want_private and zone['Name'] == zone_name:
if want_vpc_id:
# NOTE: These details aren't available in other boto methods, hence the necessary
# NOTE: These details aren't available in other boto3 methods, hence the necessary
# extra API call
hosted_zone = route53.get_hosted_zone(aws_retry=True, Id=zone_id)
if want_vpc_id in [v['VPCId'] for v in hosted_zone['VPCs']]:
Expand Down
2 changes: 0 additions & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,3 @@
# - tests/integration/targets/setup_botocore_pip
botocore>=1.19.0
boto3>=1.16.0
# Final released version
boto>=2.49.0
Empty file removed scripts/inventory/__init__.py
Empty file.
219 changes: 0 additions & 219 deletions scripts/inventory/ec2.ini

This file was deleted.

Loading

0 comments on commit 00037be

Please sign in to comment.