Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Dec 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/ansible/modules/cloud/opennebula/one_vm.py
Expand Up @@ -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):
Expand Down