[PR #5721/28969c61 backport][stable-6] manageiq_policies: deprecate list state (#5723)

manageiq_policies: deprecate list state (#5721)

* manageiq_policies: deprecate list state

* add changelog fragment

(cherry picked from commit 28969c61ad)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
patchback[bot] 2022-12-22 07:11:24 +01:00 committed by GitHub
parent 6037c5d1e6
commit 95f3109ddc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 18 additions and 6 deletions

View file

@ -27,7 +27,10 @@ options:
description:
- C(absent) - policy_profiles should not exist,
- C(present) - policy_profiles should exist,
- C(list) - list current policy_profiles and policies.
- >
C(list) - list current policy_profiles and policies.
This state is deprecated and will be removed 8.0.0.
Please use the module M(community.general.manageiq_policies_info) instead.
choices: ['absent', 'present', 'list']
default: 'present'
policy_profiles:
@ -163,6 +166,13 @@ def main():
resource_name = module.params['resource_name']
state = module.params['state']
if state == "list":
module.deprecate(
'The value "list" for "state" is deprecated. Please use community.general.manageiq_policies_info instead.',
version='8.0.0',
collection_name='community.general'
)
# get the action and resource type
action = actions[state]
resource_type = manageiq_entities()[resource_type_key]