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