Skip to content

Commit

Permalink
Drop deprecated options (#2320)
Browse files Browse the repository at this point in the history
SUMMARY

Drop deprecated options

ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: GomathiselviS
Reviewed-by: Mark Chappell
  • Loading branch information
alinabuzachis authored Oct 7, 2024
1 parent 1acdca4 commit 13ab07f
Show file tree
Hide file tree
Showing 9 changed files with 3 additions and 41 deletions.
3 changes: 3 additions & 0 deletions changelogs/fragments/20241004_drop_deprecations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
breaking_changes:
- aws_ec2 - the parameter ``include_extra_api_calls`` was previously deprecated and has been removed (https://github.com/ansible-collections/amazon.aws/pull/2320).
- iam_policy - the ``policies`` return key was previously deprecated and has been removed, please use ``policy_names`` instead (https://github.com/ansible-collections/amazon.aws/pull/2320).
14 changes: 0 additions & 14 deletions plugins/inventory/aws_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,6 @@
elements: dict
default: []
version_added: 1.5.0
include_extra_api_calls:
description:
- Add two additional API calls for every instance to include 'persistent' and 'events' host variables.
- Spot instances may be persistent and instances may have associated events.
- The I(include_extra_api_calls) option had been deprecated and will be removed in release 6.0.0.
type: bool
default: False
strict_permissions:
description:
- By default if a 403 (Forbidden) error code is encountered this plugin will fail.
Expand Down Expand Up @@ -803,13 +796,6 @@ def parse(self, inventory, loader, path, cache=True):
if not all(isinstance(element, (dict, str)) for element in hostnames):
self.fail_aws("Hostnames should be a list of dict and str.")

if self.get_option("include_extra_api_calls"):
self.display.deprecate(
"The include_extra_api_calls option has been deprecated and will be removed in release 9.0.0.",
version="9.0.0",
collection_name="amazon.aws",
)

result_was_cached, results = self.get_cached_result(path, cache)

if not result_was_cached:
Expand Down
16 changes: 0 additions & 16 deletions plugins/modules/iam_policy.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@
returned: When I(iam_type=role)
type: str
sample: "ExampleRole001"
policies:
description: A list of names of the inline policies embedded in the specified IAM resource (user, group, or role).
returned: always
type: list
elements: str
sample: ["READ-ONLY"]
policy_names:
description: A list of names of the inline policies embedded in the specified IAM resource (user, group, or role).
returned: always
Expand Down Expand Up @@ -293,7 +287,6 @@ def run(self):
return {
"changed": self.changed,
self._iam_type() + "_name": self.name,
"policies": self.list(),
"policy_names": self.list(),
"diff": dict(
before=self.original_policies,
Expand Down Expand Up @@ -396,15 +389,6 @@ def main():
elif iam_type == "group":
policy = GroupPolicy(**args)

module.deprecate(
(
"The 'policies' return key is deprecated and will be replaced by 'policy_names'. Both values are"
" returned for now."
),
version="9.0.0",
collection_name="amazon.aws",
)

module.exit_json(**(policy.run()))
except (BotoCoreError, ClientError) as e:
module.fail_json_aws(e)
Expand Down
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.15.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
plugins/inventory/aws_ec2.py yamllint:unparsable-with-libyaml # bug in ansible-test - https://github.com/ansible/ansible/issues/82353
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.16.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
plugins/inventory/aws_ec2.py yamllint:unparsable-with-libyaml # bug in ansible-test - https://github.com/ansible/ansible/issues/82353
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.17.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.18.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
2 changes: 0 additions & 2 deletions tests/sanity/ignore-2.19.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
plugins/modules/route53.py validate-modules:parameter-state-invalid-choice # route53_info needs improvements before we can deprecate this
plugins/inventory/aws_ec2.py pylint:collection-deprecated-version
plugins/modules/iam_policy.py pylint:collection-deprecated-version
1 change: 0 additions & 1 deletion tests/unit/plugins/inventory/test_aws_ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ def inventory():
"strict_permissions": False,
"allow_duplicated_hosts": False,
"cache": False,
"include_extra_api_calls": False,
"use_contrib_script_compatible_sanitization": False,
}
inventory.inventory = MagicMock()
Expand Down

0 comments on commit 13ab07f

Please sign in to comment.