mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-15 23:20:35 -07:00
* 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
|
||
---|---|---|
.. | ||
.keep | ||
563-update-terraform-status-test.yaml | ||
777-interfaces_file-re-escape.yml | ||
783-fix-gem-installed-versions.yaml | ||
789-pkg5-wrap-to-modify-package-list.yaml | ||
796-postgresql_privs-grant-option-bug.yaml | ||
802-pushover-device-parameter.yml | ||
811-proxmox-kvm-state-absent.yml | ||
825-bootsource-override-option.yaml | ||
831-proxmox-kvm-wait.yml | ||
843-update-slack-messages.yml | ||
858-postgresql_privs_should_allow_public_role_lowercased.yml | ||
887-rollback-if-nothing-changed.yml | ||
892-slack-token-validation.yml | ||
897-lookup-plugin-hashivault-add-approle-mount-point.yaml | ||
900-aerospike-migration-handle-unstable-cluster.yaml | ||
902-hashi_vault-token-path.yml | ||
903-enhance-redfish-manager-reset-actions.yml | ||
929-vault-namespace-support.yml | ||
939-zypper_repository_proper_failure_on_missing_python-xml.yml | ||
941-postgresql_privs_usage_on_types_option.yml | ||
943-proxmox-kvm-code-cleanup.yml | ||
homebrew-cask-at-symbol-fix.yaml |