1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins/module_utils
Alexei Znamensky 3e9a6acff7
Modhelper improvements (#1480)
* Improvements in module_helper

- added `ModuleHelperException` to handle problems specific to ModuleHelper
- updated `module_fails_on_exception` for `ModuleHelperException`
- `StateMixin`: composed names of state methods are now calculated instead of fixed.
- `CmdMixin`: added `run_command_fixed_options` to pass some parameters on every call

* Improvements in module_helper

- Named deprecations: ability to declare a `dict` of deprecations indexed by names, allowing module maintainer to trigger them by those names, and also allowing the module user to acknowledge them in a similar way.
  - Adding `ack_named_deprecations` to module's `argument_spec` when they exist.
  - Providing doc fragment for `ack_named_deprecations`.
- Added method `__quit_module__` providing a hook for code that needs to be run when quitting the module.
- Created convenience classes combining `ModuleHelper`, `StateMixin`, `CmdMixin`.

* fixed validation

* fixed validation

* changelog fragment

* Apply suggestions from code review

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

* Improvement on Named Deprecations

Per the comments in PR, we want to expose a call to a ``deprecate`` method on the module code, so that pylint can properly perform its static analysis on deprecations.

This prompted a revamp of the named deprecation feature.

* Use .get() instead of [] for the param to ack named deprecations.

* Changes from suggestions in the PR

* removed named deprecations

* Update changelogs/fragments/1480-module-helper-improvements.yml

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

* Update plugins/module_utils/module_helper.py

Co-authored-by: Felix Fontein <felix@fontein.de>
2021-01-15 21:29:23 +01:00
..
compat sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
identity keycloak: Provide meaningful error message to user (#1487) 2020-12-14 22:29:33 +01:00
net_tools Tidy up validate-modules ignores for modules: net_tools/nios (#1598) 2021-01-11 22:14:46 +01:00
oracle sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
remote_management sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
source_control sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
storage sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
__init__.py Initial commit 2020-03-09 09:11:07 +00:00
_mount.py Remove ansible.posix dependency (#1157) 2020-10-28 12:57:00 +01:00
_netapp.py Fix sanity test failures for _netapp.py. (#82) 2020-03-31 10:27:23 +02:00
_ovirt.py Un-remove wrongly removed ovirt modules and adjust deprecation to Ansible 2.14 (#353) 2020-05-18 20:43:50 +01:00
alicloud_ecs.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
cloud.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
database.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
dimensiondata.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
gitlab.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
heroku.py Initial commit 2020-03-09 09:11:07 +00:00
hwc_utils.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
ibm_sa_utils.py Initial commit 2020-03-09 09:11:07 +00:00
influxdb.py InfluxDB_database: Make the path argument conditional on the InfluxDB version (#1126) 2020-11-06 09:12:00 +01:00
ipa.py ipa module utils: BUGFIX ipa modules Cookie problem with Loadbalanced IPA and Python3 (… (#738) 2020-08-07 08:26:38 +02:00
known_hosts.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
ldap.py Initial commit 2020-03-09 09:11:07 +00:00
linode.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
lxd.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
manageiq.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
memset.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
module_helper.py Modhelper improvements (#1480) 2021-01-15 21:29:23 +01:00
oneandone.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
oneview.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
online.py Initial commit 2020-03-09 09:11:07 +00:00
opennebula.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
proxmox.py proxmox: create a common base (#1331) 2020-11-24 17:30:39 +01:00
pure.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
rax.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
redfish_utils.py Fix property name typo in get_memory_inventory() (#1484) 2020-12-14 09:45:45 +05:30
redhat.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
saslprep.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
scaleway.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
univention_umc.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
utm_utils.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
vexata.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
xenserver.py Initial commit 2020-03-09 09:11:07 +00:00