mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
CmdRunner module utils: deprecate format method as_default_type()
(#6601)
* CmdRunner module utils: deprecate format method `as_default_type()` * add changelog frag
This commit is contained in:
parent
47f39675a9
commit
c9aae5e45c
2 changed files with 7 additions and 0 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
deprecated_features:
|
||||||
|
- CmdRunner module utils - deprecate ``cmd_runner_fmt.as_default_type()`` formatter (https://github.com/ansible-collections/community.general/pull/6601).
|
|
@ -147,6 +147,11 @@ class _Format(object):
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def as_default_type(_type, arg="", ignore_none=None):
|
def as_default_type(_type, arg="", ignore_none=None):
|
||||||
|
#
|
||||||
|
# DEPRECATION: This method is deprecated and will be removed in community.general 10.0.0
|
||||||
|
#
|
||||||
|
# Instead of using the implicit formats provided here, use the explicit necessary format method.
|
||||||
|
#
|
||||||
fmt = _Format
|
fmt = _Format
|
||||||
if _type == "dict":
|
if _type == "dict":
|
||||||
return fmt.as_func(lambda d: ["--{0}={1}".format(*a) for a in iteritems(d)], ignore_none=ignore_none)
|
return fmt.as_func(lambda d: ["--{0}={1}".format(*a) for a in iteritems(d)], ignore_none=ignore_none)
|
||||||
|
|
Loading…
Add table
Reference in a new issue