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

Fix timeout detection in vmware_deploy_ovf module #45159

Merged
merged 1 commit into from
Sep 10, 2018

Conversation

albers
Copy link
Contributor

@albers albers commented Sep 4, 2018

SUMMARY

Timeout detection in wait_for_vm_ip is broken. A timeout should be communicated to its caller by returning an empty dict (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:

  • The wait_for_vm_ip function was added in New module vmware_deploy_ovf #30309 with the introduction of vmware_deploy_ovf, which seems to be the only caller so far.
  • I never actually ran into this error condition using the vmware_deploy_ovf module, probably because the preceding call to wait_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
  • Bugfix Pull Request
COMPONENT NAME

module_utils.vmware

ANSIBLE VERSION
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/user/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/user/eclipse/workspaces/liclipse/ansible/lib/ansible
  executable location = /home/user/eclipse/workspaces/liclipse/ansible/bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
ADDITIONAL INFORMATION

To force the bug, uncomment wait_for_task, use a short timeout in wait_for_vm_ip and import a template with the wait_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.

Signed-off-by: Harald Albers <github@albersweb.de>
@ansibot
Copy link
Contributor

ansibot commented Sep 4, 2018

@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. needs_triage Needs a first human triage before being processed. small_patch support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community labels Sep 4, 2018
@Akasurde Akasurde removed the needs_triage Needs a first human triage before being processed. label Sep 4, 2018
@Akasurde Akasurde self-requested a review September 4, 2018 11:55
@Akasurde Akasurde merged commit d61b449 into ansible:devel Sep 10, 2018
@Akasurde
Copy link
Member

@albers Thanks for the contribution.

@albers albers deleted the vmware_deploy_ovf-wait-for-ip branch September 10, 2018 07:46
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. cloud small_patch support:community This issue/PR relates to code supported by the Ansible community. vmware VMware community
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants