Merge pull request #7372 from nicolasvan/virtualbox-race-condition-on-vmexists

Make virtualbox vm_exists? more resilient to VirtualBox transient failures
This commit is contained in:
Seth Vargo 2016-06-06 19:19:22 -04:00
commit 63bbbc0335
4 changed files with 12 additions and 12 deletions

View File

@ -661,9 +661,9 @@ module VagrantPlugins
result = raw("showvminfo", uuid)
return true if result.exit_code == 0
# GH-2479: Sometimes this happens. In this case, retry. If
# we don't see this text, the VM really probably doesn't exist.
return false if !result.stderr.include?("CO_E_SERVER_EXEC_FAILURE")
# If vboxmanage returned VBOX_E_OBJECT_NOT_FOUND,
# then the vm truly does not exist. Any other error might be transient
return false if result.stderr.include?("VBOX_E_OBJECT_NOT_FOUND")
# Sleep a bit though to give VirtualBox time to fix itself
sleep 2

View File

@ -594,9 +594,9 @@ module VagrantPlugins
result = raw("showvminfo", uuid)
return true if result.exit_code == 0
# GH-2479: Sometimes this happens. In this case, retry. If
# we don't see this text, the VM really probably doesn't exist.
return false if !result.stderr.include?("CO_E_SERVER_EXEC_FAILURE")
# If vboxmanage returned VBOX_E_OBJECT_NOT_FOUND,
# then the vm truly does not exist. Any other error might be transient
return false if result.stderr.include?("VBOX_E_OBJECT_NOT_FOUND")
# Sleep a bit though to give VirtualBox time to fix itself
sleep 2

View File

@ -701,9 +701,9 @@ module VagrantPlugins
result = raw("showvminfo", uuid)
return true if result.exit_code == 0
# GH-2479: Sometimes this happens. In this case, retry. If
# we don't see this text, the VM really probably doesn't exist.
return false if !result.stderr.include?("CO_E_SERVER_EXEC_FAILURE")
# If vboxmanage returned VBOX_E_OBJECT_NOT_FOUND,
# then the vm truly does not exist. Any other error might be transient
return false if result.stderr.include?("VBOX_E_OBJECT_NOT_FOUND")
# Sleep a bit though to give VirtualBox time to fix itself
sleep 2

View File

@ -702,9 +702,9 @@ module VagrantPlugins
result = raw("showvminfo", uuid)
return true if result.exit_code == 0
# GH-2479: Sometimes this happens. In this case, retry. If
# we don't see this text, the VM really probably doesn't exist.
return false if !result.stderr.include?("CO_E_SERVER_EXEC_FAILURE")
# If vboxmanage returned VBOX_E_OBJECT_NOT_FOUND,
# then the vm truly does not exist. Any other error might be transient
return false if result.stderr.include?("VBOX_E_OBJECT_NOT_FOUND")
# Sleep a bit though to give VirtualBox time to fix itself
sleep 2