community.general
community.general copied to clipboard
feat: New xen orchestra module
SUMMARY
Added a xen_orchestra module to create/start/restart/stop/delete virtual machines
ISSUE TYPE
- New Module/Plugin Pull Request
COMPONENT NAME
xen_orchestra
The test ansible-test sanity --test validate-modules [explain] failed with 8 errors:
plugins/modules/xen_orchestra.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'This module requires websocket-client 1.0.0 or higher: https://github.com/websocket-client/websocket-client.'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.module: required key not provided @ data['module']. Got None
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.name: extra keys not allowed @ data['name']. Got 'xen_orchestra'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.boot_after_create.type: not a valid value for dictionary value @ data['options']['boot_after_create']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.description.type: not a valid value for dictionary value @ data['options']['description']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.label.type: not a valid value for dictionary value @ data['options']['label']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.use_ssl.type: not a valid value for dictionary value @ data['options']['use_ssl']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.validate_certs.type: not a valid value for dictionary value @ data['options']['validate_certs']['type']. Got 'boolean'
The test ansible-test sanity --test validate-modules [explain] failed with 8 errors:
plugins/modules/xen_orchestra.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'This module requires websocket-client 1.0.0 or higher: https://github.com/websocket-client/websocket-client.'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.module: required key not provided @ data['module']. Got None
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.name: extra keys not allowed @ data['name']. Got 'xen_orchestra'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.boot_after_create.type: not a valid value for dictionary value @ data['options']['boot_after_create']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.description.type: not a valid value for dictionary value @ data['options']['description']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.label.type: not a valid value for dictionary value @ data['options']['label']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.use_ssl.type: not a valid value for dictionary value @ data['options']['use_ssl']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.validate_certs.type: not a valid value for dictionary value @ data['options']['validate_certs']['type']. Got 'boolean'
The test botmeta failed with 2 errors:
.github/BOTMETA.yml:0:0: Author shinuza not mentioned as active or inactive maintainer for plugins/modules/xen_orchestra.py (mentioned are: )
.github/BOTMETA.yml:0:0: No (active or inactive) maintainer mentioned for plugins/modules/xen_orchestra.py
The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.12 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test pep8 [explain] failed with 15 errors:
plugins/modules/xen_orchestra.py:11:64: W291: trailing whitespace
plugins/modules/xen_orchestra.py:136:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:208:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:212:70: E202: whitespace before '}'
plugins/modules/xen_orchestra.py:217:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:229:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:231:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:241:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:252:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:255:1: E302: expected 2 blank lines, found 1
plugins/modules/xen_orchestra.py:258:32: E127: continuation line over-indented for visual indent
plugins/modules/xen_orchestra.py:272:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:275:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:276:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:311:1: E305: expected 2 blank lines after class or function definition, found 1
The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.12 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test pep8 [explain] failed with 15 errors:
plugins/modules/xen_orchestra.py:11:64: W291: trailing whitespace
plugins/modules/xen_orchestra.py:136:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:208:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:212:70: E202: whitespace before '}'
plugins/modules/xen_orchestra.py:217:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:229:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:231:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:241:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:252:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:255:1: E302: expected 2 blank lines, found 1
plugins/modules/xen_orchestra.py:258:32: E127: continuation line over-indented for visual indent
plugins/modules/xen_orchestra.py:272:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:275:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:276:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:311:1: E305: expected 2 blank lines after class or function definition, found 1
The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test pep8 [explain] failed with 15 errors:
plugins/modules/xen_orchestra.py:11:64: W291: trailing whitespace
plugins/modules/xen_orchestra.py:136:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:208:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:212:70: E202: whitespace before '}'
plugins/modules/xen_orchestra.py:217:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:229:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:231:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:241:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:252:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:255:1: E302: expected 2 blank lines, found 1
plugins/modules/xen_orchestra.py:258:32: E127: continuation line over-indented for visual indent
plugins/modules/xen_orchestra.py:272:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:275:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:276:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:311:1: E305: expected 2 blank lines after class or function definition, found 1
The test ansible-test sanity --test import --python 3.10 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.11 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.12 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:
plugins/modules/xen_orchestra.py:108:0: traceback: ImportError: import of "ansible.errors" is not allowed in this context
The test ansible-test sanity --test pep8 [explain] failed with 15 errors:
plugins/modules/xen_orchestra.py:11:64: W291: trailing whitespace
plugins/modules/xen_orchestra.py:136:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:208:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:212:70: E202: whitespace before '}'
plugins/modules/xen_orchestra.py:217:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:229:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:231:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:241:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:252:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:255:1: E302: expected 2 blank lines, found 1
plugins/modules/xen_orchestra.py:258:32: E127: continuation line over-indented for visual indent
plugins/modules/xen_orchestra.py:272:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:275:1: W293: blank line contains whitespace
plugins/modules/xen_orchestra.py:276:5: E303: too many blank lines (2)
plugins/modules/xen_orchestra.py:311:1: E305: expected 2 blank lines after class or function definition, found 1
The test ansible-test sanity --test pylint [explain] failed with 9 errors:
plugins/modules/xen_orchestra.py:108:0: ansible-bad-module-import: Import external package or ansible.module_utils not ansible.errors
plugins/modules/xen_orchestra.py:208:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:217:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:229:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:231:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:241:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:252:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:272:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:275:0: trailing-whitespace: Trailing whitespace
The test ansible-test sanity --test validate-modules [explain] failed with 8 errors:
plugins/modules/xen_orchestra.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'This module requires websocket-client 1.0.0 or higher: https://github.com/websocket-client/websocket-client.'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.module: required key not provided @ data['module']. Got None
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.name: extra keys not allowed @ data['name']. Got 'xen_orchestra'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.boot_after_create.type: not a valid value for dictionary value @ data['options']['boot_after_create']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.description.type: not a valid value for dictionary value @ data['options']['description']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.label.type: not a valid value for dictionary value @ data['options']['label']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.use_ssl.type: not a valid value for dictionary value @ data['options']['use_ssl']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.validate_certs.type: not a valid value for dictionary value @ data['options']['validate_certs']['type']. Got 'boolean'
The test ansible-test sanity --test pylint [explain] failed with 9 errors:
plugins/modules/xen_orchestra.py:108:0: ansible-bad-module-import: Import external package or ansible.module_utils not ansible.errors
plugins/modules/xen_orchestra.py:208:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:217:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:229:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:231:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:241:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:252:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:272:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:275:0: trailing-whitespace: Trailing whitespace
The test ansible-test sanity --test pylint [explain] failed with 9 errors:
plugins/modules/xen_orchestra.py:108:0: ansible-bad-module-import: Import external package or ansible.module_utils not ansible.errors
plugins/modules/xen_orchestra.py:208:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:217:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:229:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:231:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:241:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:252:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:272:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:275:0: trailing-whitespace: Trailing whitespace
The test ansible-test sanity --test validate-modules [explain] failed with 8 errors:
plugins/modules/xen_orchestra.py:0:0: import-error: Exception attempting to import module for argument_spec introspection, 'This module requires websocket-client 1.0.0 or higher: https://github.com/websocket-client/websocket-client.'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.module: required key not provided @ data['module']. Got None
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.name: extra keys not allowed @ data['name']. Got 'xen_orchestra'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.boot_after_create.type: not a valid value for dictionary value @ data['options']['boot_after_create']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.description.type: not a valid value for dictionary value @ data['options']['description']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.label.type: not a valid value for dictionary value @ data['options']['label']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.use_ssl.type: not a valid value for dictionary value @ data['options']['use_ssl']['type']. Got 'boolean'
plugins/modules/xen_orchestra.py:0:0: invalid-documentation: DOCUMENTATION.options.validate_certs.type: not a valid value for dictionary value @ data['options']['validate_certs']['type']. Got 'boolean'
The test ansible-test sanity --test pylint [explain] failed with 9 errors:
plugins/modules/xen_orchestra.py:108:0: ansible-bad-module-import: Import external package or ansible.module_utils not ansible.errors
plugins/modules/xen_orchestra.py:208:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:217:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:229:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:231:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:241:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:252:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:272:0: trailing-whitespace: Trailing whitespace
plugins/modules/xen_orchestra.py:275:0: trailing-whitespace: Trailing whitespace
I've updated the code based on your comments, please note:
- Some of the code comes from the inventory plugin for Xen Orchestra, meaning that some of your suggestions should probably be backported there.
- This includes the minimum
websocket-clientversion, which as you mentioned is1.0.1in the inventory code - Among these changes the
use_ssl->use_tlschange would be breaking - I don't know at which point the code should be mutualized (e.g for future developments), or even if there are best-practices to mutualize code between the inventory plugins and modules.
I've updated the code based on your comments, please note:
* Some of the code comes from the inventory plugin for Xen Orchestra, meaning that some of your suggestions should probably be backported there.
:+1:
* Among these changes the `use_ssl` -> `use_tls` change would be breaking
If applied to the inventory plugin, yes, but there an alias can be added for the old name to keep compatibility.
* I don't know at which point the code should be mutualized (e.g for future developments), or even if there are best-practices to mutualize code between the inventory plugins and modules.
There's plugins/docs_fragments/ for common documentation, and plugins/module_utils/ for shared code.
Generally sharing similar/equal docs and code is a good idea, instead of simply copying.
Hello,
Any more updates required? @felixfontein
Ping @shinuza
needs_info
@shinuza This pullrequest is waiting for your response. Please respond or the pullrequest will be closed.
Hi, I'll take care of it this week
Sorry I was sick for a while, I'll update it this weekend and include your feedback
Sorry to hear that, hope you're doing better. Take your time. :-)
@shinuza another friendly ping :)
needs_info
@shinuza another friendly ping :)
needs_info
Hey, thanks for the ping. I've resolved most of the feedback, just a few things I need to check with my testbed. Also, if you want I can mutualize code between this and the inventory, I just need to check on other module/inventory that do this kind of stuff.
The CI failures are unrelated and will go away once you rebase or just add another commit or force-push after adjusting existing commits.
The test extra-docs failed with 1 error:
plugins/modules/xen_orchestra_instance.py:0:0: DOCUMENTATION -> options -> state -> description[4]: O(present): option name does not reference to an existing option of the module community.general.xen_orchestra_instance
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/xen_orchestra_instance.py:0:0: invalid-documentation-markup: Directive "O(present)" contains a non-existing option "present"
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/xen_orchestra_instance.py:0:0: invalid-documentation-markup: Directive "O(present)" contains a non-existing option "present"
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/xen_orchestra_instance.py:0:0: invalid-documentation-markup: Directive "O(present)" contains a non-existing option "present"
The test ansible-test sanity --test validate-modules [explain] failed with 1 error:
plugins/modules/xen_orchestra_instance.py:0:0: invalid-documentation-markup: Directive "O(present)" contains a non-existing option "present"
ping @shinuza
needs_info
@shinuza This pullrequest is waiting for your response. Please respond or the pullrequest will be closed.
I should have some time tomorrow to work on this, but I will need help with the tests
Hi @shinuza just a friendly check on this PR. Please note that it now has conflicts too, due to other changes.
@shinuza ping :)
needs_info