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
Christoph Fiehe 5e0fd1201c
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.

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

* 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.

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

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

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

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

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

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

Co-authored-by: Felix Fontein <felix@fontein.de>

* Exception placeholder added

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>

---------

Signed-off-by: Fiehe Christoph  <c.fiehe@eurodata.de>
Co-authored-by: Fiehe Christoph <c.fiehe@eurodata.de>
Co-authored-by: Felix Fontein <felix@fontein.de>
2026-02-18 07:08:49 +01:00
..
identity/keycloak keycloak_realm_localization: new module - realm localization control (#10841) 2026-02-18 07:05:34 +01:00
mh ModuleHelper: ensure compatibility with ModuleTestCase (#11488) 2026-02-18 07:08:49 +01:00
net_tools/pritunl Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
oracle Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
remote_management/lxca Add more module_utils typing (#11283) 2025-12-15 19:46:51 +01:00
source_control Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
storage Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +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 Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
_lxc.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
_stormssh.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
alicloud_ecs.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
android_sdkmanager.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
btrfs.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
cloud.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
cmd_runner.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
cmd_runner_fmt.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
consul.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
csv.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
database.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
datetime.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
deps.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
dimensiondata.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
django.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
gandi_livedns_api.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
gconftool2.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
gio_mime.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
gitlab.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
heroku.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
homebrew.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
hwc_utils.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ibm_sa_utils.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ilo_redfish_utils.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
influxdb.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ipa.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
jenkins.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
known_hosts.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ldap.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
linode.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
locale_gen.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
lxd.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
manageiq.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
memset.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
module_helper.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
ocapi_utils.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
oneandone.py Address issues reported by ruff check (#11043) 2025-11-08 17:05:21 +13:00
onepassword.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
oneview.py replace redundant to_native()/to_text() occurrences, batch 7 (#11112) 2025-11-13 10:38:29 +13:00
online.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
opennebula.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
pacemaker.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
pipx.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
pkg_req.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
puppet.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
python_runner.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
redfish_utils.py Update check_availability_service to return data instead of boolean (#11504) 2026-02-14 21:05:57 +01:00
redis.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
rundeck.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
saslprep.py Deprecate unused module utils (#11205) 2025-11-25 06:50:06 +01:00
scaleway.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
snap.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
ssh.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
systemd.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
univention_umc.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
utm_utils.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
vardict.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
version.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
vexata.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
wdc_redfish_utils.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
xdg_mime.py Add basic typing for module_utils (#11222) 2025-12-01 20:40:06 +01:00
xenserver.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
xfconf.py Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00