From b1ce9fb3c25985a868a7ea6aa9c5383ecc01d331 Mon Sep 17 00:00:00 2001 From: Mark Chappell Date: Fri, 7 Jan 2022 21:38:17 +0100 Subject: [PATCH] aws_kms_info: Correct deprecation of keys_attr (#851) aws_kms_info: Correct deprecation of keys_attr SUMMARY fixup derecation of keys_attr. ISSUE TYPE Feature Pull Request COMPONENT NAME aws_kms_info ADDITIONAL INFORMATION #838 Reviewed-by: Markus Bergholz Reviewed-by: Jill R Reviewed-by: None --- ...8-ignore-deprecated-param-aws_kms_info.yml | 4 ++-- plugins/modules/aws_kms_info.py | 21 ++++++++----------- 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/changelogs/fragments/838-ignore-deprecated-param-aws_kms_info.yml b/changelogs/fragments/838-ignore-deprecated-param-aws_kms_info.yml index adbe22965cb..403d96d1e27 100644 --- a/changelogs/fragments/838-ignore-deprecated-param-aws_kms_info.yml +++ b/changelogs/fragments/838-ignore-deprecated-param-aws_kms_info.yml @@ -1,2 +1,2 @@ -breaking_changes: - - aws_kms_info - Deprecated ``keys_attr`` field is now ignored (https://github.com/ansible-collections/community.aws/pull/838). +deprecated_features: + - aws_kms_info - Deprecated ``keys_attr`` field is now ignored and will be removed in version 4.0.0 (https://github.com/ansible-collections/community.aws/pull/838). diff --git a/plugins/modules/aws_kms_info.py b/plugins/modules/aws_kms_info.py index ee1649984f1..671bf6f7447 100644 --- a/plugins/modules/aws_kms_info.py +++ b/plugins/modules/aws_kms_info.py @@ -47,14 +47,11 @@ type: bool keys_attr: description: - - Whether to return the results in the C(keys) attribute as well as the - C(kms_keys) attribute. - - Returning the C(keys) attribute conflicts with the builtin keys() - method on dictionaries and as such has been deprecated. - - After version C(3.0.0) this parameter will do nothing, and after - version C(4.0.0) this parameter will be removed. + - Returning the C(keys) attribute conflicted with the builtin keys() + method on dictionaries and as such was deprecated. + - This parameter now does nothing, and after version C(4.0.0) this + parameter will be removed. type: bool - default: True version_added: 2.0.0 extends_documentation_fragment: - amazon.aws.aws @@ -451,7 +448,7 @@ def main(): key_id=dict(aliases=['key_arn']), filters=dict(type='dict'), pending_deletion=dict(type='bool', default=False), - keys_attr=dict(type='bool', default=True), + keys_attr=dict(type='bool'), ) module = AnsibleAWSModule(argument_spec=argument_spec, @@ -468,11 +465,11 @@ def main(): ret_params = dict(kms_keys=filtered_keys) # We originally returned "keys" - if module.params['keys_attr']: + if module.params.get('keys_attr') is not None: module.deprecate("Returning results in the 'keys' attribute conflicts with the builtin keys() method on " - "dicts and as such is deprecated and is now ignored. Please use the kms_keys attribute. This warning can be " - "silenced by setting keys_attr to False.", - version='3.0.0', collection_name='community.aws') + "dicts and as such was removed in version 3.0.0. Please use the kms_keys attribute. " + "This parameter is now ignored and will be removed in version 4.0.0.", + version='4.0.0', collection_name='community.aws') module.exit_json(**ret_params)