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/tests/unit/plugins
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
..
become Fix more become plugins (#708) 2020-07-29 20:27:16 +02:00
cache Bump version to 2.0.0 (#1369) 2020-11-26 14:26:36 +01:00
callback Fix AZP CI (#1508) 2020-12-18 11:48:28 +01:00
connection Removal of docker content for 2.0.0 (#1304) 2020-11-23 13:03:19 +01:00
inventory proxmox: ignore QEMU templates altogether (#1185) 2020-10-30 19:51:49 +01:00
lookup Add Thycotic DevOps Secrets Vault lookup plugin (#90) 2020-07-13 05:45:07 +00:00
module_utils Modhelper improvements (#1480) 2021-01-15 21:29:23 +01:00
modules npm - handle json decode exception (#1625) 2021-01-14 14:18:41 +01:00
__init__.py Initial commit 2020-03-09 09:11:07 +00:00