Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PR #8889/fea0ffa5 backport][stable-9] one_image/one_image_info: refactor #8984

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Oct 5, 2024

This is a backport of PR #8889 as merged into main (fea0ffa).

SUMMARY

Refactor one_image and one_image_info modules to support more parameters and make it more simillar to one_vnet and one_template to reuse already existing OpenNebula class from module_utils
Fixes #3578

ISSUE TYPE
  • Refactoring Pull Request
COMPONENT NAME

one_image
one_image_info

ADDITIONAL INFORMATION

As i already mention the goal is to make these 2 modules use already existing OpenNebula class from module_utils to reuse already existing methods, i also added fully extended parameters that these 2 modules in return (using xsd scheme from https://github.com/privazio/pyone/blob/master/pyone/xsd/image.xsd)
There were also some problems with images that have id=0 because of incorrect if statements so i fixed them in process
I also added persistent to images (see related issue) and tested all of these on my OpenNebula server and everything is working as intended

# Now this is much more verbose
- name: Gather facts about all images
  community.general.one_image_info:
  register: result

# As well as this
- name: Fetch the IMAGE by id
  community.general.one_image:
    id: 45
    state: present
  register: result

# Now this would work
- name: Make the IMAGE persistent
  community.general.one_image:
    id: 37
    persistent: true

* Refactor one_image

* Refactor one_image_info

* Add examples one_image

* Add CHANGELOG fragment

* Add integration tests for one_image

* Add integration tests for one_image_info

* Update one_image DOC

* Update one_image_info DOC

* Update one_image DOC

* Update one_image_info DOC

* Fix f-strings for one_image

* Update CHANGELOG fragment

* PR fixes

* PR fixes

(cherry picked from commit fea0ffa)
@felixfontein felixfontein merged commit 02f1238 into stable-9 Oct 5, 2024
140 checks passed
@felixfontein felixfontein deleted the patchback/backports/stable-9/fea0ffa5aa8d90a01616e596e03c6e78fb3f887c/pr-8889 branch October 5, 2024 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants