mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
(cherry picked from commit 8076f16aa9
)
Co-authored-by: Marcin <stolarek.marcin@gmail.com>
This commit is contained in:
parent
bffe4c2a3b
commit
4d22d0790d
2 changed files with 3 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- proxmox_kvm - fix a bug when getting a state of VM without name will fail (https://github.com/ansible-collections/community.general/pull/4508).
|
|
@ -1397,7 +1397,7 @@ def main():
|
||||||
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
module.fail_json(msg='VM with name = %s does not exist in cluster' % name)
|
||||||
vm = proxmox.get_vm(vmid)
|
vm = proxmox.get_vm(vmid)
|
||||||
if not name:
|
if not name:
|
||||||
name = vm['name']
|
name = vm.get('name', '(unnamed)')
|
||||||
current = proxmox.proxmox_api.nodes(vm['node']).qemu(vmid).status.current.get()['status']
|
current = proxmox.proxmox_api.nodes(vm['node']).qemu(vmid).status.current.get()['status']
|
||||||
status['status'] = current
|
status['status'] = current
|
||||||
if status:
|
if status:
|
||||||
|
|
Loading…
Reference in a new issue