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
patchback[bot] 7713202d9b
Adding module_utils/module_helper.py + big revamp in xfconf.py to use it (#1322) (#1336)
* Big revamp in xfconf.py

- added plugin/module_utils/module_helper.py
  - scaffold class for writing modules, beyond standard AnsibleModule
  - automatic capture of exceptions
  - easier dependency testing
  - StateMixin to easily handle different behaviours for 'state' param
  - CmdMixin to easily run external commands
- adapted test_xfconf.py
  - the args for run_command are now lists instead of a string
  - value and previous_value were not being tested before (because xfconf wasn't filling results - see below)
  - added more tests: setting value to previous_value, getting non-existent property
- rewritten xfconf module, keeping the same results
  - original module posted results as ansible_facts, this version still does it for compatibility, but also adds to the module result

* Added suggestions from the PR

* Added russoz as maintainer for the module_utils/module_helper.py file

* Formatting using printf-style requires special treatment

Strings not containing substitution tokens must work as well.

* Tidied up variables in module definition

* Tests with ArgFormat and DependencyCtxMgr

* pytest parameters must be in the same order, it seems

* improved testing for the DependencyCtxMgr

* fixed test for older pythons

* Moved changed property to improve readability

* Added testcase for state: absent and adjusted xfconf after it

* Fixed param name environ_update in run_command()

* added changelog fragment

* fixed tests after run_command param change

(cherry picked from commit e3fcc7de2a)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2020-11-20 12:43:23 +01:00
..
action iptables_state: fix race condition between module and its action plugin (#1140) (#1143) 2020-10-20 22:46:12 +02:00
become Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
cache Fix the linode inventory plugin, and the redis and memcached cache plugins (#1281, #1282, #1283). 2020-11-13 22:06:41 +01:00
callback Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
connection Improve plugin sanity (#966) (#984) 2020-09-29 04:04:05 +00:00
doc_fragments Tidy up validate-modules ignores for remote_management/manageiq modules (#1272) (#1275) 2020-11-12 09:00:42 +01:00
filter JC plugin (#750) 2020-08-18 08:30:37 +02:00
inventory Fix the linode inventory plugin, and the redis and memcached cache plugins (#1281, #1282, #1283). 2020-11-13 22:06:41 +01:00
lookup Fix hashi_vault lookup approle authentication (#1138) (#1315) 2020-11-16 16:40:54 +00:00
module_utils Adding module_utils/module_helper.py + big revamp in xfconf.py to use it (#1322) (#1336) 2020-11-20 12:43:23 +01:00
modules Adding module_utils/module_helper.py + big revamp in xfconf.py to use it (#1322) (#1336) 2020-11-20 12:43:23 +01:00