Fix timeout detection in vmware_deploy_ovf module #45159
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SUMMARY
Timeout detection in
wait_for_vm_ip
is broken. A timeout should be communicated to its caller by returning an emptydict
(see vmware_deploy_ovf). But the function always returns the fully populated facts, regardless of the timeout condition.With this PR, the facts are only returned if no timeout occurred.
Notes:
wait_for_vm_ip
function was added in New module vmware_deploy_ovf #30309 with the introduction ofvmware_deploy_ovf
, which seems to be the only caller so far.vmware_deploy_ovf
module, probably because the preceding call towait_for_task
returns late enough so that the ip address is available anyway.But the bug might hit other callers, so it should be fixed.
ISSUE TYPE
COMPONENT NAME
module_utils.vmware
ANSIBLE VERSION
ADDITIONAL INFORMATION
To force the bug, uncomment
wait_for_task
, use a short timeout in wait_for_vm_ip and import a template with thewait_for_ip_address=true
option. This will trigger the timeout condition. The module should fail.Instead the module returns with
"ipv4": null
but does not fail.