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/modules/cloud/misc
Tristan Le Guern 02e80c610b
proxmox_kvm: code cleanup (#934)
* 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
2020-09-23 16:39:46 +03:00
..
cloud_init_data_facts.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
helm.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
ovirt.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
proxmox.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
proxmox_kvm.py proxmox_kvm: code cleanup (#934) 2020-09-23 16:39:46 +03:00
proxmox_template.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
rhevm.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
serverless.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
terraform.py Reduce ignored sanity tests in cloud/misc modules (#845) 2020-09-01 13:44:04 +02:00
xenserver_facts.py modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00