opkg: deprecate value "" for force (#9172)
* opkg: deprecate value "" for force * fix sanity plus wording * add comments for future removal * add changelog fragpull/9223/head
parent
34010a788a
commit
d826dd1c88
|
@ -0,0 +1,2 @@
|
||||||
|
deprecated_features:
|
||||||
|
- opkg - deprecate value ``""`` for parameter ``force`` (https://github.com/ansible-collections/community.general/pull/9172).
|
|
@ -46,8 +46,7 @@ options:
|
||||||
force:
|
force:
|
||||||
description:
|
description:
|
||||||
- The C(opkg --force) parameter used.
|
- The C(opkg --force) parameter used.
|
||||||
- Passing V("") as value and not passing any value at all have both
|
- State V("") is deprecated and will be removed in community.general 12.0.0. Please omit the parameter O(force) to obtain the same behavior.
|
||||||
the same effect of B(not) using any C(--force-) parameter.
|
|
||||||
choices:
|
choices:
|
||||||
- ""
|
- ""
|
||||||
- "depends"
|
- "depends"
|
||||||
|
@ -152,7 +151,11 @@ class Opkg(StateModuleHelper):
|
||||||
)
|
)
|
||||||
|
|
||||||
def _force(value):
|
def _force(value):
|
||||||
|
# 12.0.0 function _force() to be removed entirely
|
||||||
if value == "":
|
if value == "":
|
||||||
|
self.deprecate('Value "" is deprecated. Simply omit the parameter "force" to prevent any --force-X argument when running opkg',
|
||||||
|
version="12.0.0",
|
||||||
|
collection_name="community.general")
|
||||||
value = None
|
value = None
|
||||||
return cmd_runner_fmt.as_optval("--force-")(value, ctx_ignore_none=True)
|
return cmd_runner_fmt.as_optval("--force-")(value, ctx_ignore_none=True)
|
||||||
|
|
||||||
|
@ -164,7 +167,7 @@ class Opkg(StateModuleHelper):
|
||||||
arg_formats=dict(
|
arg_formats=dict(
|
||||||
package=cmd_runner_fmt.as_list(),
|
package=cmd_runner_fmt.as_list(),
|
||||||
state=cmd_runner_fmt.as_map(state_map),
|
state=cmd_runner_fmt.as_map(state_map),
|
||||||
force=cmd_runner_fmt.as_func(_force),
|
force=cmd_runner_fmt.as_func(_force), # 12.0.0 replace with cmd_runner_fmt.as_optval("--force-")
|
||||||
update_cache=cmd_runner_fmt.as_bool("update"),
|
update_cache=cmd_runner_fmt.as_bool("update"),
|
||||||
version=cmd_runner_fmt.as_fixed("--version"),
|
version=cmd_runner_fmt.as_fixed("--version"),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Reference in New Issue