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
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
..
compat sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
docker Initial commit 2020-03-09 09:11:07 +00:00
identity Initial commit 2020-03-09 09:11:07 +00:00
net_tools sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02: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) (#1191) 2020-10-28 20:57:07 +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
gcdns.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
gce.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
gcp.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
hetzner.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) (#1236) 2020-11-06 13:48:18 +01:00
ipa.py ipa module utils: BUGFIX ipa modules Cookie problem with Loadbalanced IPA and Python3 (… (#738) 2020-08-18 08:30:04 +02:00
known_hosts.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02:00
kubevirt.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 Adding module_utils/module_helper.py + big revamp in xfconf.py to use it (#1322) (#1336) 2020-11-20 12:43: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
postgres.py sanity: Add future boilerplate (#573) 2020-06-24 21:50:36 +02: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 Support same reset actions on Managers as on Systems (#903) (#947) 2020-09-23 09:04:51 +02:00
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