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/changelogs/fragments
patchback[bot] a163ec3afa
Command Runner (#4476) (#4572)
* initial commit, passing unit tests

* passing one very silly integration test

* multiple changes:

- updated copyright year
- cmd_runner
  - added fmt_optval
  - created specific exceptions
  - fixed bug in context class where values from module params were not
    being used for resolving cmd arguments
  - changed order of class declaration for readability purpose
- tests
  - minor improvements in integration test code
  - removed some extraneous code in msimple.yml
  - minor improvements in unit tests
  - added few missing cases to unit test

* multiple changes

cmd_runner.py

- renamed InvalidParameterName to MissingArgumentFormat
  - improved exception parameters
- added repr and str to all exceptions
- added unpacking decorator for fmt functions
- CmdRunner
  - improved parameter validation
- _CmdRunnerContext
  - Context runs must now pass named arguments
  - Simplified passing of additional arguments to module.run_command()
  - Provided multiple context variables with info about the run

Integration tests

- rename msimple.py to cmd_echo.py for clarity
- added more test cases

* cmd_runner: env update can be passed to runner

* adding runner context info to output

* added comment on OrderedDict

* wrong variable

* refactored all fmt functions into static methods of a class

Imports should be simpler now, only one object fmt, with attr access to all callables

* added unit tests for CmdRunner

* fixed sanity checks

* fixed mock imports

* added more unit tests for CmdRunner

* terminology consistency

* multiple adjustments:

- remove extraneous imports
- renamed some variables
- added wrapper around arg formatters to handle individual arg ignore_none behaviour

* removed old code commented out in test

* multiple changes:

- ensure fmt functions return list of strings
- renamed fmt parameter from `option` to `args`
- renamed fmt.mapped to fmt.as_map
- simplified fmt.as_map
- added tests for fmt.as_fixed

* more improvements in formats

* fixed sanity

* args_order can be a string (to be split())

and improved integration test

* simplified integration test

* removed overkill str() on values - run_command does that for us

* as_list makes more sense than as_str in that context

* added changelog fragment

* Update plugins/module_utils/cmd_runner.py

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

* adjusted __repr__ output for the exceptions

* added superclass object to classes

* added additional comment on the testcase sample/example

* suggestion from PR

Co-authored-by: Felix Fontein <felix@fontein.de>
(cherry picked from commit f5b1b3c6f0)

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
2022-04-25 22:26:36 +02:00
..
.keep Rename changelogs/fragments/.empty -> changelogs/fragments/.keep 2020-08-07 08:17:57 +02:00
4.8.0.yml Prepare 4.8.0 release. 2022-04-22 23:31:28 +02:00
4084-add-redfish-system-indicator-led.yml Redfish: Added IndicatorLED commands to the Systems category (#4458) (#4494) 2022-04-11 20:22:58 +02:00
4320-nmcli-hairpin.yml nmcli: Change hairpin default mode (#4334) (#4558) 2022-04-23 08:49:33 +02:00
4377-allow-proxmox-snapshot-restoring.yml Allow Proxmox Snapshot Restoring (#4377) (#4571) 2022-04-25 06:54:22 +02:00
4438-fix-error-message.yaml modules/xbps: fix error message (#4438) (#4489) 2022-04-11 08:01:32 +02:00
4455-terraform-provider-upgrade.yml Terraform init -upgrade flag (#4455) (#4502) 2022-04-13 19:22:08 +02:00
4457-support-datadog-monitors-type-event-v2.yaml Fix filename. 2022-04-22 23:29:56 +02:00
4459-only-get-monitor-if-it-is-not-null-api-response.yaml dnsmadeeasy: only get monitor if it is not null api response (#4459) (#4500) 2022-04-13 11:16:39 +00:00
4464-pacman-fix-local-remove.yaml pacman: Fix removing locally installed packages (#4464) (#4504) 2022-04-13 19:21:46 +02:00
4465-btrfs-resize.yml Implement btrfs resize support (#4465) (#4498) 2022-04-13 11:16:27 +00:00
4466-proxmox-ansible_host-deprecation.yml Deprecate want_proxmox_nodes_ansible_host option's default value. (#4466) (#4478) 2022-04-10 08:59:25 +02:00
4471-seport-refactor.yaml seport: minor refactor (#4471) (#4485) 2022-04-10 18:48:44 +02:00
4476-cmd_runner.yml Command Runner (#4476) (#4572) 2022-04-25 22:26:36 +02:00
4479-add-project-support-for-lxd_container-and-lxd_profile.yml Add project support for lxd_container and lxd_profile module (#4479) (#4561) 2022-04-22 22:49:29 +02:00
4491-specify_all_in_list_calls.yaml gitlab: Use all=True in most list() calls (#4491) (#4503) 2022-04-13 13:43:21 +02:00
4492-proxmox_kvm_fix_vm_without_name.yaml Correctly handle exception when no VM name returned by proxmox (#4508) (#4529) 2022-04-19 20:04:43 +02:00
4496-remove-deprecated-method-in-gitlab-branch-module.yml remove deprecated branch.unprotect() method in community.general.gitlab_branch (#4496) (#4528) 2022-04-19 20:04:51 +02:00
4506-sudo-in-nmap-inv-plugin.yaml nmap inventory plugin: Add sudo nmap (#4506) (#4544) 2022-04-21 10:10:56 +02:00
4524-update-opennebula-inventory-plugin-to-match-documentation.yaml Implement contructable support for opennebula inventory plugin: keyed… (#4524) (#4549) 2022-04-21 14:03:37 +02:00
4526-keycloak-realm-types.yaml Fix keycloak realm parameters types (#4526) (#4560) 2022-04-23 08:49:44 +02:00
4530-fix-unauthorized-pritunl-request.yaml [pritunl] removed unnecessary data from auth string (#4530) (#4538) 2022-04-20 09:33:57 +02:00
4534-xfconf-added-value-types.yaml xfconf: added missing value types (#4534) (#4541) 2022-04-20 21:33:05 +02:00
4540-proxmox-inventory-token-auth.yml Proxmox inventory: implement API token auth (#4540) (#4570) 2022-04-24 16:06:19 +02:00
4556-remove-default-none-1.yml Removed 'default=None' in a batch of modules (#4556) (#4568) 2022-04-24 10:49:45 +02:00
4567-remove-default-none-2.yml Removed 'default=None' in a batch of modules 2 (#4567) (#4569) 2022-04-24 10:49:29 +02:00