mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
add range_start and range_end agrs when query vm by a single id (#50056)
This commit is contained in:
parent
4a82ea8392
commit
53eb3ad1e8
1 changed files with 5 additions and 5 deletions
|
@ -614,12 +614,12 @@ def get_vm_by_id(client, vm_id):
|
|||
# -2: All vms user can Use
|
||||
# -1: Vms belonging to the user and any of his groups - default
|
||||
# >= 0: UID User's vms
|
||||
pool.info(filter=-2)
|
||||
pool.info(filter=-2, range_start=int(vm_id), range_end=int(vm_id))
|
||||
|
||||
for vm in pool:
|
||||
if str(vm.id) == str(vm_id):
|
||||
return vm
|
||||
return None
|
||||
if len(pool) == 1:
|
||||
return pool[0]
|
||||
else:
|
||||
return None
|
||||
|
||||
|
||||
def get_vms_by_ids(module, client, state, ids):
|
||||
|
|
Loading…
Reference in a new issue