mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add int parse handling
This commit is contained in:
parent
bf94f08bc4
commit
db2aac4254
1 changed files with 2 additions and 1 deletions
|
@ -127,7 +127,8 @@ class ProxmoxAnsible(object):
|
||||||
return vms[0]
|
return vms[0]
|
||||||
|
|
||||||
def get_vm(self, vmid, ignore_missing=False):
|
def get_vm(self, vmid, ignore_missing=False):
|
||||||
vms = [vm for vm in self.proxmox_api.cluster.resources.get(type='vm') if vm['vmid'] == int(vmid)]
|
vmid = int(vmid) if vmid is not None else None
|
||||||
|
vms = [vm for vm in self.proxmox_api.cluster.resources.get(type='vm') if vmid and vm['vmid'] == vmid]
|
||||||
|
|
||||||
if vms:
|
if vms:
|
||||||
return vms[0]
|
return vms[0]
|
||||||
|
|
Loading…
Reference in a new issue