add range_start and range_end agrs when query vm by a single id (#50056)

pull/50187/head
Youhua Li 6 years ago committed by ansibot
parent 4a82ea8392
commit 53eb3ad1e8

@ -614,11 +614,11 @@ def get_vm_by_id(client, vm_id):
# -2: All vms user can Use # -2: All vms user can Use
# -1: Vms belonging to the user and any of his groups - default # -1: Vms belonging to the user and any of his groups - default
# >= 0: UID User's vms # >= 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 len(pool) == 1:
if str(vm.id) == str(vm_id): return pool[0]
return vm else:
return None return None

Loading…
Cancel
Save