1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-11 02:25:36 +00:00
community.general/plugins
Hirofumi Arimoto 213581bef8
fix: treat chdev execution failures as module errors in aix_devices (#12185)
* fix: treat chdev execution failures as module errors in aix_devices

##### SUMMARY
Fix the aix_devices module so that a failed chdev command is reported as a module failure instead of a successful result.

The previous implementation called fail_json incorrectly by returning success through the normal completion path when chdev returned a non-zero exit status. This could allow a playbook to continue even though the requested device attribute change was not applied.

This change replaces the success-style error handling with proper failure handling in the chdev execution path, making task results consistent with the actual command outcome.

##### ISSUE TYPE
- Bugfix Pull Request

##### COMPONENT NAME
aix_devices

##### ADDITIONAL INFORMATION
The affected code path is in change_device_attr() when the module executes chdev to apply attribute updates.

Before this change:
- chdev could fail
- the module could still report success
- later tasks could run against an unexpected system state

After this change:
- chdev failures are returned through fail_json
- the task stops with an error
- playbook behavior matches the real execution result

```paste below
Before:
module.exit_json(msg="Failed to run chdev.", rc=rc, err=err)

After:
module.fail_json(msg="Failed to run chdev.", rc=rc, err=err)
```

* Add changelog fragment for aix_devices chdev failure fix (#12185)

---------

Co-authored-by: Hirofumi Arimoto <harimoto@jp.ibm.com>
2026-06-05 13:02:06 +02:00
..
action iptables_state: clean up code (#12093) 2026-05-25 14:58:55 +02:00
become pfexec become plugin: fix broken defaults for illumos/SmartOS (#11623) 2026-04-25 21:12:36 +02:00
cache Sort imports with ruff check --fix (#11400) 2026-01-09 07:40:58 +01:00
callback unixy callback: fix KeyError when task is delegated to host without ansible_host set (#12113) 2026-05-30 20:02:20 +02:00
connection Fix incus Windows modules with ansible-core 2.21 (#12163) 2026-06-02 21:04:02 +02:00
doc_fragments kopia: Add kopia_repository module (#11752) 2026-05-30 13:38:30 +02:00
filter version_sort filter: fix example's description (#12167) 2026-06-02 18:22:05 +02:00
inventory multiple: replace namedtuple with dataclass (#12094) 2026-05-25 15:50:34 +02:00
lookup filetree lookup: handle invalid exclude regex with AnsibleError (#12140) 2026-06-04 06:19:10 +02:00
module_utils redfish_config: fix KeyError: 'ret' when SetManagerNic cannot find a matching NIC (#12124) 2026-06-02 18:25:26 +02:00
modules fix: treat chdev execution failures as module errors in aix_devices (#12185) 2026-06-05 13:02:06 +02:00
plugin_utils Lookup plugins: prevent using _terms for positional arguments, and reject positional arguments completely for lookups that don't use them (#12060) 2026-05-17 09:43:21 +02:00
test Make all doc fragments, module utils, and plugin utils private (#11896) 2026-04-20 20:16:26 +02:00