mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[PR #6512/64f74e12 backport][stable-7] cpanm: deprecate default mode (#6589)
cpanm: deprecate default mode (#6512)
* cpanm: deprecate default mode
* add changelog frag
(cherry picked from commit 64f74e1228
)
Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
parent
703519197f
commit
f663fe73c1
2 changed files with 12 additions and 2 deletions
2
changelogs/fragments/6512-cpanm-default-mode.yml
Normal file
2
changelogs/fragments/6512-cpanm-default-mode.yml
Normal file
|
@ -0,0 +1,2 @@
|
|||
deprecated_features:
|
||||
- cpanm - value ``compatibility`` is deprecated as default for parameter ``mode`` (https://github.com/ansible-collections/community.general/pull/6512).
|
|
@ -68,9 +68,9 @@ options:
|
|||
mode:
|
||||
description:
|
||||
- Controls the module behavior. See notes below for more details.
|
||||
- Default is C(compatibility) but that behavior is deprecated and will be changed to C(new) in community.general 9.0.0.
|
||||
type: str
|
||||
choices: [compatibility, new]
|
||||
default: compatibility
|
||||
version_added: 3.0.0
|
||||
name_check:
|
||||
description:
|
||||
|
@ -158,7 +158,7 @@ class CPANMinus(ModuleHelper):
|
|||
mirror_only=dict(type='bool', default=False),
|
||||
installdeps=dict(type='bool', default=False),
|
||||
executable=dict(type='path'),
|
||||
mode=dict(type='str', choices=['compatibility', 'new'], default='compatibility'),
|
||||
mode=dict(type='str', choices=['compatibility', 'new']),
|
||||
name_check=dict(type='str')
|
||||
),
|
||||
required_one_of=[('name', 'from_path')],
|
||||
|
@ -176,6 +176,14 @@ class CPANMinus(ModuleHelper):
|
|||
|
||||
def __init_module__(self):
|
||||
v = self.vars
|
||||
if v.mode is None:
|
||||
self.deprecate(
|
||||
"The default value 'compatibility' for parameter 'mode' is being deprecated "
|
||||
"and it will be replaced by 'new'",
|
||||
version="9.0.0",
|
||||
collection_name="community.general"
|
||||
)
|
||||
v.mode = "compatibility"
|
||||
if v.mode == "compatibility":
|
||||
if v.name_check:
|
||||
self.do_raise("Parameter name_check can only be used with mode=new")
|
||||
|
|
Loading…
Reference in a new issue