From 1ad9fb637ef092b6a2652d606e5cb7225ccb447a Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Tue, 5 Jul 2022 15:03:22 +0200 Subject: [PATCH 1/2] Drop deprecated aliases --- plugins/modules/ec2_ami.py | 39 +++++++-------------- plugins/modules/ec2_vpc_dhcp_option_info.py | 27 +++++--------- tests/sanity/ignore-2.12.txt | 2 -- tests/sanity/ignore-2.13.txt | 2 -- tests/sanity/ignore-2.14.txt | 2 -- 5 files changed, 20 insertions(+), 52 deletions(-) diff --git a/plugins/modules/ec2_ami.py b/plugins/modules/ec2_ami.py index 8388f8dd9f4..85216ca077a 100644 --- a/plugins/modules/ec2_ami.py +++ b/plugins/modules/ec2_ami.py @@ -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: @@ -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. @@ -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) " - - "Constantin Bugneac (@Constantin07) " - - "Ross Williams (@gunzy83) " - - "Willem van Ketwich (@wilvk) " + - "Evan Duffield (@scicoin-project) " + - "Constantin Bugneac (@Constantin07) " + - "Ross Williams (@gunzy83) " + - "Willem van Ketwich (@wilvk) " 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. @@ -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'), diff --git a/plugins/modules/ec2_vpc_dhcp_option_info.py b/plugins/modules/ec2_vpc_dhcp_option_info.py index 4d15761b017..e8a223d37ee 100644 --- a/plugins/modules/ec2_vpc_dhcp_option_info.py +++ b/plugins/modules/ec2_vpc_dhcp_option_info.py @@ -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: @@ -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 = ''' @@ -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( diff --git a/tests/sanity/ignore-2.12.txt b/tests/sanity/ignore-2.12.txt index 891870fcf01..087a21dd146 100644 --- a/tests/sanity/ignore-2.12.txt +++ b/tests/sanity/ignore-2.12.txt @@ -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 diff --git a/tests/sanity/ignore-2.13.txt b/tests/sanity/ignore-2.13.txt index 891870fcf01..087a21dd146 100644 --- a/tests/sanity/ignore-2.13.txt +++ b/tests/sanity/ignore-2.13.txt @@ -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 diff --git a/tests/sanity/ignore-2.14.txt b/tests/sanity/ignore-2.14.txt index 891870fcf01..087a21dd146 100644 --- a/tests/sanity/ignore-2.14.txt +++ b/tests/sanity/ignore-2.14.txt @@ -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 From 2be138d11e6c3c5c220f51f3a37964eab335517f Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Tue, 5 Jul 2022 15:57:46 +0200 Subject: [PATCH 2/2] changelog --- changelogs/fragments/913-deprecations.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 changelogs/fragments/913-deprecations.yml diff --git a/changelogs/fragments/913-deprecations.yml b/changelogs/fragments/913-deprecations.yml new file mode 100644 index 00000000000..7c5ede5d3da --- /dev/null +++ b/changelogs/fragments/913-deprecations.yml @@ -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).