Skip to content

Commit

Permalink
proxmox: Refactor
Browse files Browse the repository at this point in the history
This is a squash of the following commits for easier rebasing:

proxmox module_utils: make use of choose_first_if_multiple in get_vm

proxmox: refactor module

proxmox: add changelog

proxmox: fix deprecation message

proxmox: remove type hints

proxmox: remove spaces for keywords

proxmox: run formatter

proxmox: make compabtible with old python versions

proxmox: remove f-strings

proxmox: fix string formatting in build_volume

proxmox: revert disk size parameter to simple integer

proxmox: update changelog fragment

proxmox: fix argument spec

proxmox: fix size handling in build_volume

proxmox: fix formatting

proxmox: update changelog fragment
  • Loading branch information
Lithimlin committed Jan 9, 2025
1 parent 568fcea commit 0c87d71
Show file tree
Hide file tree
Showing 3 changed files with 1,049 additions and 631 deletions.
9 changes: 9 additions & 0 deletions changelogs/fragments/9225-proxmox-module-refactoring.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
minor_changes:
- proxmox - refactors the proxmox module (https://github.com/ansible-collections/community.general/pull/9225)
- proxmox - fixes idempotency of template conversions (https://github.com/ansible-collections/community.general/pull/9225, https://github.com/ansible-collections/community.general/issues/8811).
- proxmox - fixes issues with disk_volume variable (https://github.com/ansible-collections/community.general/pull/9225, https://github.com/ansible-collections/community.general/issues/9065).
- proxmox - fixes incorrect parsing for bind-only mounts (https://github.com/ansible-collections/community.general/pull/9225, https://github.com/ansible-collections/community.general/issues/8982).
- proxmox module utils - fixes ignoring of ``choose_first_if_multiple`` argument in ``get_vmid`` (https://github.com/ansible-collections/community.general/pull/9225)

deprecated_features:
- proxmox - removes default value of ``update`` parameter. This will be changed to a default of ``true`` in the future (https://github.com/ansible-collections/community.general/pull/9225)
2 changes: 1 addition & 1 deletion plugins/module_utils/proxmox.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def get_vmid(self, name, ignore_missing=False, choose_first_if_multiple=False):
return None

self.module.fail_json(msg='No VM with name %s found' % name)
elif len(vms) > 1:
elif len(vms) > 1 and not choose_first_if_multiple:
self.module.fail_json(msg='Multiple VMs with name %s found, provide vmid instead' % name)

return vms[0]
Expand Down
Loading

0 comments on commit 0c87d71

Please sign in to comment.