mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-23 05:10:22 -07:00
XenServer: Documentation improvements and fixes for XenServer related modules (#53498)
- More info added to module docs. - Fixed errors and typos in module docs. - Added parameter types to module docs. - Some error messages are fixed and/or changed to be more helpful. - Some code comments changed and added. - Updated unit tests that test changed error messages. - Improved module examples. - Improved docs for custom_params xenserver_guest module parameter
This commit is contained in:
parent
acf3e73250
commit
e775434a52
7 changed files with 138 additions and 99 deletions
|
@ -19,12 +19,12 @@ testcase_set_vm_power_state_bad_transitions = {
|
|||
('restarted', 'Suspended', "Cannot restart VM in state 'suspended'!"),
|
||||
('suspended', 'Halted', "Cannot suspend VM in state 'poweredoff'!"),
|
||||
('suspended', 'Paused', "Cannot suspend VM in state 'paused'!"),
|
||||
('shutdownguest', 'Halted', "Cannot shutdown guest when VM is in state 'poweredoff'."),
|
||||
('shutdownguest', 'Suspended', "Cannot shutdown guest when VM is in state 'suspended'."),
|
||||
('shutdownguest', 'Paused', "Cannot shutdown guest when VM is in state 'paused'."),
|
||||
('rebootguest', 'Halted', "Cannot reboot guest when VM is in state 'poweredoff'."),
|
||||
('rebootguest', 'Suspended', "Cannot reboot guest when VM is in state 'suspended'."),
|
||||
('rebootguest', 'Paused', "Cannot reboot guest when VM is in state 'paused'."),
|
||||
('shutdownguest', 'Halted', "Cannot shutdown guest when VM is in state 'poweredoff'!"),
|
||||
('shutdownguest', 'Suspended', "Cannot shutdown guest when VM is in state 'suspended'!"),
|
||||
('shutdownguest', 'Paused', "Cannot shutdown guest when VM is in state 'paused'!"),
|
||||
('rebootguest', 'Halted', "Cannot reboot guest when VM is in state 'poweredoff'!"),
|
||||
('rebootguest', 'Suspended', "Cannot reboot guest when VM is in state 'suspended'!"),
|
||||
('rebootguest', 'Paused', "Cannot reboot guest when VM is in state 'paused'!"),
|
||||
],
|
||||
"ids": [
|
||||
"poweredoff->restarted",
|
||||
|
|
|
@ -20,7 +20,9 @@ def test_xenserverobject_xenapi_lib_detection(mocker, fake_ansible_module, xense
|
|||
with pytest.raises(FailJsonException) as exc_info:
|
||||
xenserver.XenServerObject(fake_ansible_module)
|
||||
|
||||
assert exc_info.value.kwargs['msg'] == "XenAPI.py required for this module! Please download XenServer SDK and copy XenAPI.py to your site-packages."
|
||||
assert exc_info.value.kwargs['msg'] == ("XenAPI Python library is required for this module! "
|
||||
"Please download XenServer SDK and copy XenAPI.py to your Python site-packages. "
|
||||
"Check Notes section in module documentation for more info.")
|
||||
|
||||
|
||||
def test_xenserverobject_xenapi_failure(mock_xenapi_failure, fake_ansible_module, xenserver):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue