1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00
community.general/plugins
Tristan Le Guern 4a5276b589
proxmox_kvm: code cleanup (#934) (#956)
* proxmox_kvm: remove redundant parameters

The functions start_vm() and stop_vm() receive four common parameters:
module, proxmox, vm and vmid.
The last too are redundant so keep only vm.

I also took the opportunity to remove extra API calls to proxmox.nodes()
by assigning its return value to a variable.

* proxmox_kvm: remove extra calls to status.current

The get_vm() function already returns an array of properties containing
the status so remove extra API calls to retrieve this information.

Example:

    [{''netin'': 177232, ''name'': ''test-instance'', ''maxcpu'': 1, ''node'': ''prx-01'', ''disk'': 0, ''template'': 0, ''uptime'': 267, ''cpu'': 0.0410680030805531, ''diskread'': 165294744, ''maxdisk'': 10737418240, ''vmid'': 42, ''status'': ''running'', ''id'': ''qemu/42'', ''maxmem'': 536870912, ''diskwrite'': 18528256, ''netout'': 2918, ''type'': ''qemu'', ''mem'': 160284950}]

* proxmox_kvm: kill VZ_TYPE global variable

It reduces readability without providing much values nowadays.

* proxmox_kvm: simplify vmid generation

Forgotten suggestion from Felix Fontein in PR#811.

* proxmox_kvm: add changelog fragment for PR#934

(cherry picked from commit 02e80c610b)
2020-09-25 12:54:14 +02:00
..
action New module: shutdown (#700) 2020-08-18 08:29:38 +02:00
become Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
cache Clean up deprecations (#504) 2020-06-16 13:15:19 +02:00
callback Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
connection Fix plugins (names, constants, FQCNs in examples) (#722) 2020-08-18 08:29:44 +02:00
doc_fragments Scaleway - Fix api_token documentation (#747) 2020-08-18 08:30:30 +02:00
filter JC plugin (#750) 2020-08-18 08:30:37 +02:00
inventory Fix various sanity errors in plugins (#881) (#893) 2020-09-17 16:39:57 +00:00
lookup hashi_vault - Change token_path env var loading precedence (#902) (#938) 2020-09-21 13:57:32 +02:00
module_utils Support same reset actions on Managers as on Systems (#903) (#947) 2020-09-23 09:04:51 +02:00
modules proxmox_kvm: code cleanup (#934) (#956) 2020-09-25 12:54:14 +02:00