Skip to content

Commit

Permalink
Drop deprecated (CamelCase) aliases (#913)
Browse files Browse the repository at this point in the history
Drop deprecated (CamelCase) aliases

SUMMARY
Complete the deprecation cycle on CamelCased aliases
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_ami
ec2_vpc_dhcp_option_info
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis <None>
  • Loading branch information
tremble authored Jul 5, 2022
1 parent ca9ed18 commit ae5e8b6
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 52 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/913-deprecations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
breaking_changes:
- ec2_ami - the parameter aliases ``DeviceName``, ``VirtualName`` and ``NoDevice`` were previously deprecated and have been removed, please use ``device_name``, ``virtual_name`` and ``no_device`` instead (https://github.com/ansible-collections/amazon.aws/pull/913).
- ec2_vpc_dhcp_option_info - the parameter aliases ``DhcpOptionIds`` and ``DryRun`` were previously deprecated and have been removed, please use ``dhcp_options_ids`` and ``no_device`` instead (https://github.com/ansible-collections/amazon.aws/pull/913).
39 changes: 12 additions & 27 deletions plugins/modules/ec2_ami.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
---
module: ec2_ami
version_added: 1.0.0
short_description: Create or destroy an image (AMI) in ec2
short_description: Create or destroy an image (AMI) in EC2
description:
- Registers or deregisters ec2 images.
- Registers or deregisters EC2 images.
options:
instance_id:
description:
Expand Down Expand Up @@ -80,25 +80,16 @@
type: str
description:
- The device name. For example C(/dev/sda).
- The C(DeviceName) alias had been deprecated and will be removed in
release 5.0.0.
required: yes
aliases: ['DeviceName']
virtual_name:
type: str
description:
- The virtual name for the device.
- See the AWS documentation for more detail U(https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_BlockDeviceMapping.html).
- The C(VirtualName) alias has been deprecated and will be removed in
release 5.0.0.
aliases: ['VirtualName']
no_device:
type: bool
description:
- Suppresses the specified device included in the block device mapping of the AMI.
- The C(NoDevice) alias has been deprecated and will be removed in
release 5.0.0.
aliases: ['NoDevice']
volume_type:
type: str
description: The volume type. Defaults to C(gp2) when not set.
Expand Down Expand Up @@ -151,14 +142,14 @@
- Set to simple to enable enhanced networking with the Intel 82599 Virtual Function interface for the AMI and any instances that you launch from the AMI.
type: str
author:
- "Evan Duffield (@scicoin-project) <[email protected]>"
- "Constantin Bugneac (@Constantin07) <[email protected]>"
- "Ross Williams (@gunzy83) <[email protected]>"
- "Willem van Ketwich (@wilvk) <[email protected]>"
- "Evan Duffield (@scicoin-project) <[email protected]>"
- "Constantin Bugneac (@Constantin07) <[email protected]>"
- "Ross Williams (@gunzy83) <[email protected]>"
- "Willem van Ketwich (@wilvk) <[email protected]>"
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.tags.deprecated_purge
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.tags.deprecated_purge
'''

# Thank you to iAcquire for sponsoring development of this module.
Expand Down Expand Up @@ -703,15 +694,9 @@ def rename_item_if_exists(dict_object, attribute, new_attribute, child_node=None

def main():
mapping_options = dict(
device_name=dict(
type='str', aliases=['DeviceName'], required=True,
deprecated_aliases=[dict(name='DeviceName', version='5.0.0', collection_name='amazon.aws')]),
virtual_name=dict(
type='str', aliases=['VirtualName'],
deprecated_aliases=[dict(name='VirtualName', version='5.0.0', collection_name='amazon.aws')]),
no_device=dict(
type='bool', aliases=['NoDevice'],
deprecated_aliases=[dict(name='NoDevice', version='5.0.0', collection_name='amazon.aws')]),
device_name=dict(type='str', required=True),
virtual_name=dict(type='str'),
no_device=dict(type='bool'),
volume_type=dict(type='str'),
delete_on_termination=dict(type='bool'),
snapshot_id=dict(type='str'),
Expand Down
27 changes: 8 additions & 19 deletions plugins/modules/ec2_vpc_dhcp_option_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
---
module: ec2_vpc_dhcp_option_info
version_added: 1.0.0
short_description: Gather information about dhcp options sets in AWS
short_description: Gather information about DHCP options sets in AWS
description:
- Gather information about dhcp options sets in AWS.
- Gather information about DHCP options sets in AWS.
author: "Nick Aslanidis (@naslanidis)"
options:
filters:
Expand All @@ -22,25 +22,18 @@
type: dict
dhcp_options_ids:
description:
- Get details of specific DHCP Option IDs.
- The C(DhcpOptionIds) alias has been deprecated and will be removed in
release 5.0.0.
aliases: ['DhcpOptionIds']
- Get details of specific DHCP option IDs.
type: list
elements: str
dry_run:
description:
- Checks whether you have the required permissions to view the DHCP
Options.
- The C(DryRun) alias has been deprecated and will be removed in
release 5.0.0.
aliases: ['DryRun']
options.
type: bool
default: false
extends_documentation_fragment:
- amazon.aws.aws
- amazon.aws.ec2
- amazon.aws.aws
- amazon.aws.ec2
'''

EXAMPLES = '''
Expand Down Expand Up @@ -200,12 +193,8 @@ def list_dhcp_options(client, module):
def main():
argument_spec = dict(
filters=dict(type='dict', default={}),
dry_run=dict(
type='bool', default=False, aliases=['DryRun'],
deprecated_aliases=[dict(name='DryRun', version='5.0.0', collection_name='amazon.aws')]),
dhcp_options_ids=dict(
type='list', elements='str', aliases=['DhcpOptionIds'],
deprecated_aliases=[dict(name='DhcpOptionIds', version='5.0.0', collection_name='amazon.aws')]),
dry_run=dict(type='bool', default=False),
dhcp_options_ids=dict(type='list', elements='str'),
)

module = AnsibleAWSModule(
Expand Down
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.12.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
plugins/modules/ec2_ami.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_ami.py validate-modules:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_instance.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_key.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vol.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_dhcp_option_info.py validate-modules:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_endpoint.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_net.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_route_table.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.13.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
plugins/modules/ec2_ami.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_ami.py validate-modules:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_instance.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_key.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vol.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_dhcp_option_info.py validate-modules:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_endpoint.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_net.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_route_table.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.14.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
plugins/modules/ec2_ami.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_ami.py validate-modules:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_instance.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_key.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vol.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_dhcp_option_info.py validate-modules:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_endpoint.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_net.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0
plugins/modules/ec2_vpc_route_table.py pylint:collection-deprecated-version # Deprecation planned for 5.0.0

0 comments on commit ae5e8b6

Please sign in to comment.