1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2026-06-15 12:27:38 +00:00

xenserver_guest_info: use fallback chain for VDI format detection (#12215)

* xenserver_guest_info: use fallback chain for VDI format detection

* changelog: add PR URL to
  changelog fragment

* test: set mismatched vdi_type in vm-3 fixture to test fallback chain precedence

Set vdi_type to "vhd" while image-format remains "qcow2" so the unit
test verifies that image-format takes precedence in the fallback chain.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Shreyash 2026-06-12 16:37:13 +05:30 committed by GitHub
parent 7b8ed586da
commit 4d72ec3299
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 6 deletions

View file

@ -456,7 +456,13 @@ def gather_vm_facts(module: AnsibleModule, vm_params):
"os_device": vm_vbd_params["device"],
"uuid": vm_vbd_params["VDI"]["uuid"],
"vbd_userdevice": vm_vbd_params["userdevice"],
"vdi_type": vm_vbd_params["VDI"].get("sm_config", {}).get("vdi_type", ""),
"vdi_type": vm_vbd_params["VDI"]["sm_config"].get(
"image-format",
vm_vbd_params["VDI"]["sm_config"].get(
"vdi_type",
vm_vbd_params["VDI"]["sm_config"].get("type", "raw"),
),
),
}
vm_facts["disks"].append(vm_disk_params)