1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-03-22 05:09:12 +00:00
community.general/plugins/module_utils
patchback[bot] 42c20a754b
[PR #11488/5e0fd120 backport][stable-12] ModuleHelper: ensure compatibility with ModuleTestCase (#11518)
ModuleHelper: ensure compatibility with `ModuleTestCase` (#11488)

* ModuleHelper: ensure compatibility with `ModuleTestCase`.

This change allows to configure the `module_fails_on_exception` decorator by passing a tuple of exception types that should not be handled by the decorator itself. In the context of `ModuleTestCase`, use `(AnsibleExitJson, AnsibleFailJson)` to let them pass through the decorator without modification.



* Another approach allowing user-defined exception types to pass through the decorator. When the decorator should have no arguments at all, we must hard code the name of the attribute that is looked up on self.



* Approach that removes decorator parametrization and relies on an object/class variable named `unhandled_exceptions`.



* context manager implemented that allows to pass through some exception types



* Update changelogs/fragments/11488-mh-ensure-compatibiliy-with-module-tests.yml



* Exception placeholder added



---------




(cherry picked from commit 5e0fd1201c)

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>
Co-authored-by: Christoph Fiehe <cfiehe@users.noreply.github.com>
Co-authored-by: Fiehe Christoph <c.fiehe@eurodata.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-18 07:26:47 +01:00
..
identity/keycloak [PR #11503/85a0deee backport][stable-12] keycloak module utils: group search optimization (#11511) 2026-02-14 21:14:52 +01:00
mh [PR #11488/5e0fd120 backport][stable-12] ModuleHelper: ensure compatibility with ModuleTestCase (#11518) 2026-02-18 07:26:47 +01:00
net_tools/pritunl [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
oracle [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
remote_management/lxca [PR #11283/ef632145 backport][stable-12] Add more module_utils typing (#11289) 2025-12-17 21:24:55 +01:00
source_control [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
storage [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
__init__.py Add __init__.py to work around ansible-test/pylint bug (#10926) 2025-10-15 21:42:55 +02:00
_filelock.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
_lxc.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
_stormssh.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
alicloud_ecs.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
android_sdkmanager.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
btrfs.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
cloud.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
cmd_runner.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
cmd_runner_fmt.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
consul.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
csv.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
database.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
datetime.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
deps.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
dimensiondata.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
django.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
gandi_livedns_api.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
gconftool2.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
gio_mime.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
gitlab.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
heroku.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
homebrew.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
hwc_utils.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ibm_sa_utils.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ilo_redfish_utils.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
influxdb.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ipa.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
jenkins.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
known_hosts.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ldap.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
linode.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
locale_gen.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
lxd.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
manageiq.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
memset.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
module_helper.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
ocapi_utils.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
oneandone.py [PR #11043/3478863e backport][stable-12] Address issues reported by ruff check (#11047) 2025-11-08 09:49:52 +01:00
onepassword.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
oneview.py [PR #11112/f5c2c8b9 backport][stable-12] replace redundant to_native()/to_text() occurrences, batch 7 (#11142) 2025-11-13 06:09:17 +01:00
online.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
opennebula.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
pacemaker.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
pipx.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
pkg_req.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
puppet.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
python_runner.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
redfish_utils.py [PR #11504/8729f563 backport][stable-12] Update check_availability_service to return data instead of boolean (#11510) 2026-02-14 21:14:07 +01:00
redis.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
rundeck.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
saslprep.py [PR #11205/d364e354 backport][stable-12] Deprecate unused module utils (#11213) 2025-11-25 21:41:56 +01:00
scaleway.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
snap.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
ssh.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
systemd.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
univention_umc.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
utm_utils.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
vardict.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
version.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
vexata.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
wdc_redfish_utils.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
xdg_mime.py [PR #11222/c7f6a28d backport][stable-12] Add basic typing for module_utils (#11243) 2025-12-01 21:16:37 +01:00
xenserver.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00
xfconf.py [PR #11400/236b9c0e backport][stable-12] Sort imports with ruff check --fix (#11409) 2026-01-09 19:36:52 +01:00