CmdRunner module utils: deprecate format method `as_default_type()` (#6601)
* CmdRunner module utils: deprecate format method `as_default_type()` * add changelog fragpull/6613/head
parent
47f39675a9
commit
c9aae5e45c
|
@ -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
|
||||
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)
|
||||
|
|
Loading…
Reference in New Issue