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
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
..
alicloud modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
atomic sanity: Fix sanity check for modules (#587) 2020-07-31 10:57:57 +02:00
centurylink modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
dimensiondata modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
docker New Docker Stack Task Info Module with Tests (#732) 2020-08-18 08:29:59 +02:00
google Restore removed google modules (#675) 2020-07-21 07:45:32 +01:00
heroku modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
huawei modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
kubevirt modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
linode modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
lxc modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
lxd module lxd_container - added target parameter for cluster deployments (#711) 2020-07-30 12:30:25 +03:00
memset modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
misc proxmox_kvm: code cleanup (#934) (#956) 2020-09-25 12:54:14 +02:00
oneandone modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
online modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
opennebula modules: fix examples to use FQCN for builtin plugins (#661) 2020-07-16 14:42:12 +03:00
oracle modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
ovh modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
ovirt modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
packet modules: fix examples to use FQCN for builtin plugins (#661) 2020-07-16 14:42:12 +03:00
profitbricks modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
pubnub modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
rackspace modules: fix examples to use FQCN for builtin plugins (#661) 2020-07-16 14:42:12 +03:00
scaleway Scaleway Database Backup : Create new module (#741) (#909) 2020-09-17 19:24:11 +02:00
smartos modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
softlayer modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
spotinst modules: fix examples to use FQCN for builtin modules (#648) 2020-07-14 18:28:08 +03:00
univention modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
webfaction modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00
xenserver modules: fix examples to use FQCN (#644) 2020-07-13 21:50:31 +02:00