1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix for vmadm get_vm_uuid out of range (#5628)

* Fix for vmadm get_vm_uuid out of range  

* Fix for vmadm get_vm_uuid out of range

* Update changelogs/fragments/5628-fix-vmadm-off-by-one.yml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Carlos Neira 2022-11-30 18:41:35 -03:00 committed by GitHub
parent f7fa54eed9
commit b8545d10e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- vmadm - fix for index out of range error in ``get_vm_uuid`` (https://github.com/ansible-collections/community.general/pull/5628).

View file

@ -438,7 +438,7 @@ def get_vm_prop(module, uuid, prop):
def get_vm_uuid(module, alias): def get_vm_uuid(module, alias):
# Lookup the uuid that goes with the given alias. # Lookup the uuid that goes with the given alias.
# Returns the uuid or '' if not found. # Returns the uuid or '' if not found.
cmd = [module.vmadm, 'lookup', '-j', '-o', 'uuid', 'alias={1}'.format(alias)] cmd = [module.vmadm, 'lookup', '-j', '-o', 'uuid', 'alias={0}'.format(alias)]
(rc, stdout, stderr) = module.run_command(cmd) (rc, stdout, stderr) = module.run_command(cmd)