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

Check new VM for IP to ensure it's been assigned before returning #68

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

samiam
Copy link

@samiam samiam commented Oct 31, 2018

Blocks premature restarts w/o IP

This needs to be tested a bit more.

lib/vsphere.rb Outdated
wait = wait - poll_interval
sleep poll_interval
end
if wait <= 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably super unlikely but if you are kicked out of this loop once wait == 0 and the new_vm is permuted to get an IP it would be possible to give a false error. Your could instead check if the ip is still nil once you've left this loop if new_vm.guest_ip.nil?. That would also protect you from a nil ip in your else statement.

Copy link
Contributor

@drewby08 drewby08 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants