1
0
Fork 0
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:
Alexei Znamensky 2023-05-31 17:58:28 +12:00 committed by GitHub
parent 47f39675a9
commit c9aae5e45c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 0 deletions

View file

@ -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).

View file

@ -147,6 +147,11 @@ class _Format(object):
@staticmethod
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
if _type == "dict":
return fmt.as_func(lambda d: ["--{0}={1}".format(*a) for a in iteritems(d)], ignore_none=ignore_none)