1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
Commit graph

200 commits

Author SHA1 Message Date
Martin
ee39fd5c90
Allow for DN's to have {x} prefix on first RDN (#5450)
* Allow for DN's to have {x} prefix on first RDN

* Update changelogs/fragments/5450-allow-for-xordered-dns.yaml

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

* Assign attrs to throw-away var

* Update plugins/module_utils/ldap.py

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

* Escape DN before creating filter

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-11-05 12:43:28 +01:00
Guillaume MARTINEZ
5fe0f57033
[Scaleway] Add module to manage function namespaces (#5415)
* [Scaleway] Add module to manage function namespaces

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* rename short_descriptions

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* handle changed verification on hashed secret values

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix syntax for python 2.6

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing argon2 in unittest

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* fix missing value on description field

Signed-off-by: Lunik <lunik@tiwabbit.fr>

Signed-off-by: Lunik <lunik@tiwabbit.fr>
2022-11-02 20:11:04 +01:00
Mike Raineri
ea3550d838
Redfish: centralize payload inspection logic and OEM logic (#5425)
* Redfish: centralize payload checking when performing modification requests to a Redfish service

* CI fixes

* Updates based on unit testing

* CI fix

* Modified vendor-specific logic to establish common pattern for workarounds
2022-11-02 07:40:21 +01:00
Felix Fontein
2830a3452d
Remove deprecated features, bump version to 6.0.0 (#5326)
* Bump version to 6.0.0.

* sender option is now required.

* Default of want_proxmox_nodes_ansible_host changed from true to false.

* username is now an alias of user, and no longer of workspace.

* Remove deprecated return values in favor of end_state.

* Remove debug option.

* Change default of ignore_volatile_options from true to false.

* gitlab_group must now always contain the full path.

* Change default of norc from false to ture.

* Remove deprecated property.

* Add PR URL.

* Adjust bitbucket unit tests.

* Adjust module_helper integration test.
2022-10-25 08:07:21 +02:00
Guillaume MARTINEZ
2680739153
[Scaleway] Add module to manage container registries (#5399)
* [Scaleway] Add module to manage container registries

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* first review

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* lint documentation on return value

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review *bis

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* second review *ter

Signed-off-by: Lunik <lunik@tiwabbit.fr>

* Fix typo.

Signed-off-by: Lunik <lunik@tiwabbit.fr>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-23 17:18:06 +02:00
Alexei Znamensky
91cac4c816
MH CmdModuleHelper: deprecation (#5370)
* MH CmdModuleHelper: deprecation

* add changelog fragment

* add deprecation comments in many parts of the code
2022-10-23 16:34:04 +02:00
Alexei Znamensky
389dfe9f09
manageiq_tags_info: new module (#5368)
* manageiq_tags: refactor ManageIQTags class out to utils

* add manageiq_tags_info module

* refactor query_resource_id as a method in ManageIQ

* minor adjustments

* fix comments from PR

* rollback register result in examples

* add basic docs for return value
2022-10-23 11:33:07 +02:00
Alexei Znamensky
32f9d78fa3
manageiq_policies_info: new module (#5321)
* manageiq_provider_info: new module

* fix reference to manageiq.module

* add missing alias in suboption

* fix filename in botmeta

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

* fix description of parameters

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

* remove change applied on the wrong branch

* fix the module name in metadata files

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

* adjust RETURN documentation

* adjust RETURN documentation indentation

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

* Update plugins/modules/remote_management/manageiq/manageiq_policies_info.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-10-12 10:27:21 +02:00
bratwurzt
2cac3ae879
New Module: Keycloak User Rolemapping (#4898)
* keycloak_user_rolemapping: implement user role mapping

* keycloak_user_rolemapping: additional logging

* keycloak_user_rolemapping: move to getters, use names parameters

* keycloak_user_rolemapping: add service account user example

* Add keyring and keyring_info modules (#4764)

* keycloak_user_rolemapping: write tests, address ansibullbot concerns no.1

* keycloak_user_rolemapping: address felixfontein concerns no.1

* keycloak_user_rolemapping: remove rebase mistakes

* keycloak_user_rolemapping: address felixfontein concerns no.2

* keycloak_user_rolemapping: refactor duplicate username usage example

* keycloak_user_rolemapping: fix sanity check errors no.1

* keycloak_user_rolemapping: fix sanity check errors no.2

* keycloak_user_rolemapping: fix sanity check errors no.3

* keycloak_user_rolemapping: fix sanity check errors no.4

* keycloak_user_rolemapping: write tests, address ansibullbot concerns no.1

* keycloak_user_rolemapping: resolve rebase conflicts with origin/main branch

# Conflicts:
#	plugins/module_utils/identity/keycloak/keycloak.py

* keycloak_user_rolemapping: remove keycloak_role_composites from BOTMETA.yml

* keycloak_user_rolemapping: fix sanity check errors no.5

* keycloak_user_rolemapping: address felixfontein reviews concerns no.1

* keycloak_user_rolemapping: address felixfontein reviews concerns no.2

Co-authored-by: Dušan Markovič <dusan.markovic@better.care>
Co-authored-by: ahussey-redhat <93101976+ahussey-redhat@users.noreply.github.com>
2022-10-01 18:16:47 +02:00
nxet
25e3031c2f
[feat] proxmox_snap: snapshot containers with configured mountpoints (#5274)
* module_utils.proxmox: new `api_task_ok` helper + integrated with existing modules

* proxmox_snap: add `unbind` param to snapshot containers with mountpoints

* [fix] errors reported by 'test sanity pep8'
at 
https://github.com/ansible-collections/community.general/pull/5274#issuecomment-1242932079

* module_utils.proxmox.api_task_ok: small improvement

* proxmox_snap.unbind: version_added, formatting errors, changelog fragment

* Apply suggestions from code review

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

* proxmox_snap.unbind: update version_added tag

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-28 22:48:11 +02:00
tejabailey
d9d830a168
Add SetSessionService to redfish_config (#5009)
* Add SetSessionService to redfish_config
adding SetSessionService command to redfish_config
to set BMC default session timeout policy.

Fixes #5008

* fix white space issues

* Making Requested changes:
 - changed category from SessionService to Sessions
 - changed set_sessionservice() to set_session_service()
 - other misc. changes for cleanup

* Apply suggestions from code review

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>

* Fix issues with checks

* Fix issues with checks part 2

* Fix issues with checks part 3

* Update plugins/modules/remote_management/redfish/redfish_config.py

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

Co-authored-by: Alexei Znamensky <103110+russoz@users.noreply.github.com>
Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-25 17:07:45 +02:00
Alexei Znamensky
35e3a9615a
pipx module utils: removed unused import (#5288) 2022-09-18 11:52:15 +02:00
Alexei Znamensky
6b463e6fa6
gitlab modules: improved imports (#5259)
* gitlab modules: improved imports

* add changelog fragment

* refactored the import check to its sole function
2022-09-12 20:30:02 +02:00
Alexei Znamensky
775be1d3f3
multiple modules: removed unused imports (#5240)
* multiple modules: removed unused imports

* fixed ali_instance(_info) import check

* add changelog fragment

* Update changelogs/fragments/5240-unused-imports.yaml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-09 22:23:48 +02:00
Mike Moerk
2a449eb163
WDC Redfish support for setting the power mode. (#5145)
* WDC Redfish support for setting the power mode.

* Apply suggestions from code review

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

* Add change fragment.

* Add extension to changelog fragment.

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-09-03 12:45:03 +02:00
jixj5
766c109d47
Update redfish module for compatibility with VirtualMedia resource location (#5124)
* Update redfish module for compatibility with VirtualMedia resource location from Manager to Systems

* Add changelogs fragments for PR 5124

* Update some issue according to the suggestions

* update changelogs fragment to list new features in the minor_changes catagory

Co-authored-by: Tami YY3 Pan <panyy3@lenovo.com>
2022-08-24 21:36:35 +02:00
Felix Fontein
a54af8909c
Fix linting errors; fix some real bugs (#5111)
* Fix linting errors.

* Fix bugs.

* Another linter error ignored.

* More fixes.

* Ignore sanity errors with older versions.

ci_complete

* Forgot to commit more changes.
2022-08-12 11:07:30 +02:00
Felix Fontein
aab22e7f32
Add remaining copyright statements, add licenses sanity test (#5098)
* Add sanity test (currently fails).

* doc_fragments can also be non-GPLv3+.

* Replace 'Author:' by 'Copyright:' in some specific cases.

* Avoid matching string for license checkers.

* Reformulate not to throw license detection off.

* Add PSF copyright notice for plugins/module_utils/_mount.py.

* Add generic copyright notices.

* Update changelog fragment.
2022-08-08 23:23:08 +02:00
Felix Fontein
424d706f92
Fix more copyright lines, add more default copyright lines (#5095)
* Fix copyright lines.

* Add default copyright line.
2022-08-08 14:24:58 +02:00
Alexei Znamensky
2ecaa91f68
pipx: use CmdRunner (#5085)
* pipx: use CmdRunner

* added BOTMETA entry for pipx module_utils

* add changelog fragment

* add missing line

* Update plugins/module_utils/pipx.py

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

* Update plugins/module_utils/pipx.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-08 08:02:56 +02:00
Felix Fontein
2a9fd7359f
Add more license statements (#5079)
* Add more license statements. These were modified manually incorporating existing data.

* Remove accidentally added line.
2022-08-07 13:37:23 +02:00
Mike Moerk
6062ae8fae
WDC Redfish support for chassis indicator LED toggling. (#5059)
* WDC Redfish support for chassis indicator LED toggling.

* Added changelog fragment.

* Apply suggestions from code review

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-07 09:56:07 +02:00
Felix Fontein
496bf27b5c
Fix copyright lines (make sure 'Copyright' is there). (#5083) 2022-08-05 22:12:10 +02:00
Felix Fontein
123c7efe5e
Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt (#5065)
* Move licenses to LICENSES/, run add-license.py, add LICENSES/MIT.txt.

* Replace 'Copyright:' with 'Copyright'

sed -i 's|Copyright:\(.*\)|Copyright\1|' $(rg -l 'Copyright:')

Co-authored-by: Maxwell G <gotmax@e.email>
2022-08-05 12:28:29 +02:00
Mike
4eb3540c8e
WDC Redfish firmware update support for update image creds (#5056)
Allows user to specify Basic Auth credentials for firmware update image.
2022-08-02 09:54:58 +02:00
Dishant Pandya
88a3daf2ec
Fix: Add user-agent header to allow request through WAF with bot protection (#5024)
* Fix: Add user agent header to allow request through CDN/WAF with bot protection

* upate doc-fragment

* move http_agent variable assignment

* set http_agent param for all Keycloak API Requests

* Update plugins/doc_fragments/keycloak.py

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

* Update changelogs/fragments/5023-http-agent-param-keycloak.yml

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

* fix formatting

* Update plugins/doc_fragments/keycloak.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-08-01 09:35:05 +02:00
Alexei Znamensky
aba089369e
mh base: add verbosity() property (#5035)
* mh base: add verbosity property

* add changelog fragment
2022-07-31 11:28:17 +02:00
Felix Fontein
9290381bea
xfconf: fix setting of boolean values (#5007) 2022-07-27 07:42:25 +02:00
Mike
be70d18e3f
Redfish modules for Western Digital UltraStar Data102 storage enclosures (#4885)
* WDC Redfish Info / Command modules for Western Digital Ultrastar Data102 storage enclosures.
Initial commands include:
* FWActivate
* UpdateAndActivate
* SimpleUpdateStatus

* delete unnecessary __init__.py modules

* PR Feedback

Notes list not guaranteed to be sorted
Use EXAMPLES tos how specifying ioms/basuri
Import missing_required_lib

* Apply suggestions from code review

Suggestions that could be auto-committed.

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

* Remove DNSCacheBypass

It is now the caller's responsibility to deal with stale IP addresses.

* Remove dnspython dependency.

Fix bug that this uncovered.

* Apply suggestions from code review

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

* PR Feedback

* Documentation, simple update status output format, unit tests.

Add docs showing how to use SimpleUpdateStatus
Change the format of SimpleUpateStatus format, put the results in a sub-object.
Fix unit tests whose asserts weren't actually running.

* PR Feedback

register: result on the 2nd example

* Final adjustments for merging for 5.4.0

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-07-16 22:59:13 +02:00
Abhijeet Kasurde
bf94f08bc4
Misc. typo fixes (#4940)
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
2022-07-08 23:11:57 +02:00
Felix Fontein
1c06e237c8
Fix license filenames. (#4923) 2022-07-04 21:23:02 +02:00
Jacob Yundt
f60d12cf2d
Fix GetChassisPower when multiple chassis are present (#4902)
* Fix GetChassisPower when multiple chassis are present

When multiple chassis are present, and one or more of those chassis do _not_
report power information, the GetChassisPower command will fail. To address
that, only report a failure if _all_ of the Chassis objects lack power
power reporting functionality.

Fixes #4901

* Update changelogs/fragments/4901-fix-redfish-chassispower.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-30 20:36:01 +02:00
Jacob Yundt
93dcd3f54d
Add GetFirmwareVersion command to redfish_info (#4900)
* Add GetManagerInventory command to redfish_info

Adding GetManagerInventory command to redfish_info, similar to
GetSystemInventory to report Manager specific information like:
- FirmwareVersion
- Model
- ManagerType

Fixes #4899

* Update changelogs/fragments/4899-add-GetManagerInventory-for-redfish_info.yml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-30 20:35:35 +02:00
Álvaro García Jaén
265c052c27
Fix command variable usage in CmdRunner (#4903)
* Fix command variable usage

* Add changelog fragment for cmd-runner bugfix (#4903)
2022-06-30 07:08:55 +02:00
FRUCHTiii
5e57d2af0a
redfish_command: VirtualMediaInsert does not work with Supermicro (#4839)
* bugfix virtual media support for supermicro hardware

* Added Changelog for PR4839
2022-06-20 19:13:31 +02:00
Felix Fontein
dcdfc9c413
Add PSF-license.txt for plugins/module_utils/_mount.py (#4847)
* Add PSF-license.txt for plugins/module_utils/_mount.py.

* Move other licenses to licenses/.

* Revert "Move other licenses to licenses/."

This reverts commit eab4209889.
2022-06-17 08:21:34 +02:00
Alexei Znamensky
739ca737f1
cmd_runner: add __call__ method to invoke context (#4791)
* cmd_runner: add __call__ method to invoke context

* change xfconf to use the callable form

* add changelog fragment

* Update changelogs/fragments/4791-cmd-runner-callable.yaml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-15 08:06:26 +02:00
Alexei Znamensky
8ba3d94740
xfconf module utils: providing a cmd_runner object (#4776)
* xfconf: changed implementation to use cmd_runner

* added module_utils/xfconf.py

* xfconf_info: using cmd_runner

* added module_utils to BOTMETA.yml

* added changelog fragment

* use cmd_runner_fmt instead of deprecated form
2022-06-06 10:38:46 +02:00
Alexei Znamensky
b87edda3c7
ModuleHelperException module utils - improved exception initialization (#4755)
* ModuleHelperException module utils - improved exception initialization

* added changelog fragment

* Update plugins/module_utils/mh/exceptions.py

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-06-06 10:30:55 +02:00
Alexei Znamensky
2d38c8d892
cmd_runner: deprecate fmt as the name for the format class (#4777)
* cmd_runner: deprecate fmt as the name for the format class

* added changelog fragment

* fixing the deprecation comment
2022-06-05 18:37:59 +02:00
Alexei Znamensky
49836bb484
gconftool2_info: new module (#4743)
* gconftool2_info: new module

* fixed imports

* fixed docs for gconftool2_info

* fixed docs for gconftool2_info

* minor adjustment in docs

* added tests

* adjustments
2022-06-04 09:13:53 +02:00
Alexei Znamensky
be69f95f63
cmd_runner: added flag check_mode_skip to context (#4736)
* cmd_runner: added flag skip_if_check_mode to context

* added changelog fragment

* adjusted param name and added new one
2022-06-04 09:13:37 +02:00
Felix Fontein
0be68bf04b
Add simplified_bsd.txt license file (#4759)
* Add simplified_bsd.txt and adjust references.

* Add changelog.
2022-06-02 07:30:06 +02:00
Brian Coca
e55875107b
fix invalid fail_json call (#4733)
* fix invalid fail_json call

Currently causes this error:
```
TypeError: AnsibleModule.fail_json() missing 1 required positional argument: 'msg'
gitlab | FAILED! => {
    "ansible_facts": {
        "discovered_interpreter_python": "/usr/bin/python3.10"
    },
    "changed": false,
    "module_stderr": "Shared connection to 10.0.3.100 closed.\r\n",
    "module_stdout": "Traceback (most recent call last):\r\n  File \"/root/.ansible/tmp/ansible-tmp-1653579059.8318024-147674-84188943153768/AnsiballZ_redis.py\", line 107, in <module>\r\n    _ansiballz_main()\r\n  File \"/root/.ansible/tmp/ansible-tmp-1653579059.8318024-147674-84188943153768/AnsiballZ_redis.py\", line 99, in _ansiballz_main\r\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\r\n  File \"/root/.ansible/tmp/ansible-tmp-1653579059.8318024-147674-84188943153768/AnsiballZ_redis.py\", line 47, in invoke_module\r\n    runpy.run_module(mod_name='ansible_collections.community.general.plugins.modules.redis', init_globals=dict(_module_fqn='ansible_collections.community.general.plugins.modules.redis', _modlib_path=modlib_path),\r\n  File \"/usr/lib/python3.10/runpy.py\", line 209, in run_module\r\n    return _run_module_code(code, init_globals, run_name, mod_spec)\r\n  File \"/usr/lib/python3.10/runpy.py\", line 96, in _run_module_code\r\n    _run_code(code, mod_globals, init_globals,\r\n  File \"/usr/lib/python3.10/runpy.py\", line 86, in _run_code\r\n    exec(code, run_globals)\r\n  File \"/tmp/ansible_community.general.redis_payload_di15cy0s/ansible_community.general.redis_payload.zip/ansible_collections/community/general/plugins/modules/redis.py\", line 328, in <module>\r\n  File \"/tmp/ansible_community.general.redis_payload_di15cy0s/ansible_community.general.redis_payload.zip/ansible_collections/community/general/plugins/modules/redis.py\", line 195, in main\r\n  File \"/tmp/ansible_community.general.redis_payload_di15cy0s/ansible_community.general.redis_payload.zip/ansible_collections/community/general/plugins/module_utils/redis.py\", line 40, in fail_imports\r\nTypeError: AnsibleModule.fail_json() missing 1 required positional argument: 'msg'\r\n",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
```

* Add changelog.

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-30 08:03:25 +02:00
Alexei Znamensky
5d72d1be2f
ModuleHelper: added a do_raise() method to MH base class (#4660)
* ModuleHelper: added a do_raise() method to MH base class

* added changelog fragment

* Update changelogs/fragments/4660-mh-added-do-raise.yaml

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

* Update plugins/module_utils/mh/base.py

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

* using do_raise in CmdMixin

* simplified do_raise()

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-13 20:40:17 +02:00
Sam Doran
9e1af2d1bc
onepassword - Get first found config file (#4640)
* Get first found configuration file

There are three valid places to get the configuration.

https://developer.1password.com/docs/cli/about-biometric-unlock#remove-old-account-information

* Use common config class

* Add changelog fragment

* Explicitly use new style classes for Python 2.7 compatibility

This shouldn’t matter for lookups, but does matter for module_utils
and modules since Python 2.7 is still supported on the managed node.

* Update changelogs/fragments/4065-onepassword-config.yml

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-09 07:24:35 +02:00
Alexei Znamensky
bca7f09b71
ModuleHelper module utils: delegates unknown attributes to AnsibleModule (#4600)
* ModuleHelper module util: delegates unknown attributes to AnsibleModule

* added changelog fragment

* delegate only a few selected attrs

* Update plugins/module_utils/mh/base.py

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

* Update changelogs/fragments/4600-mh-delegate.yaml

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-09 07:10:49 +02:00
Adam Robinson
f8889d1dd8
redfish_command: VirtualMediaInsert does not work with HPE iLO4 (#4596)
* Inserted not supported in patch on some hardware

Signed-off-by: Adam Robinson <adarobin@umich.edu>

* return error for ilo4 options with no defaults

* Update changelog

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

* make virtual_media_insert_via_patch backwards compatible

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

* remove ilo 4 specific properties check

* return ExtendedInfo as a string if no Message

* only worry about Inserted and WriteProtected

* update changelog

* fix for PEP8

* fix up comments

* fix VirtualMediaEject for iLO4 as well

* update changlog

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

Co-authored-by: Felix Fontein <felix@fontein.de>
2022-05-05 07:56:26 +02:00
Felix Fontein
54b2f0819d
[5.0.0] Bump version to 5.0.0, remove deprecated features (#4516)
* Remove deprecated features.

* Fix changelog.

* Remove ignore.txt entries.

* One more.

* Remove state=get tests.
2022-04-26 11:45:15 +02:00
Alexei Znamensky
f5b1b3c6f0
Command Runner (#4476)
* 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>
2022-04-25 22:12:00 +02:00