Bump version of main to 12.0.0; execute announced deprecations (#10883)

* Bump version to 12.0.0.

* Remove deprecated modules and plugins.

* state is now required.

* Change default of prepend_hash from auto to never.

* Remove support for force=''.

* Always delegate 'debug'.

* Remove ignore_value_none and ctx_ignore_none parameters.

* Remove parameters on_success and on_failure.

* Update BOTMETA.

* Adjust docs reference.

* Forgot required=True.

* Fix changelog fragment.

* Adjust unit tests.

* Fix changelog.

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

---------

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
This commit is contained in:
Felix Fontein 2025-10-09 13:50:07 +02:00 committed by GitHub
commit 0b72737cab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
22 changed files with 43 additions and 901 deletions

View file

@ -13,22 +13,16 @@ from functools import wraps
from ansible_collections.community.general.plugins.module_utils.mh.exceptions import ModuleHelperException
def cause_changes(on_success=None, on_failure=None, when=None):
# Parameters on_success and on_failure are deprecated and should be removed in community.general 12.0.0
def cause_changes(when=None):
def deco(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
try:
func(self, *args, **kwargs)
if on_success is not None:
self.changed = on_success
elif when == "success":
if when == "success":
self.changed = True
except Exception:
if on_failure is not None:
self.changed = on_failure
elif when == "failure":
if when == "failure":
self.changed = True
raise
finally: