guests/linux: only successful mount if exit status 0

This commit is contained in:
Mitchell Hashimoto 2013-09-20 17:50:29 -07:00
parent 138024d74c
commit 62e357ffcd
2 changed files with 7 additions and 3 deletions

View File

@ -12,6 +12,8 @@ BUG FIXES:
in the installer context. [GH-2231]
- core: Clear `DYLD_LIBRARY_PATH` on Mac if the subprocess is executing
a setuid or setgid script. [GH-2243]
- guests/linux: Don't raise exception right away if mounting fails, allow
retries. [GH-2234]
- hosts/arch: Vagrant won't crash on Arch anymore. [GH-2233]
## 1.3.3 (September 18, 2013)

View File

@ -28,17 +28,19 @@ module VagrantPlugins
success = true
mount_commands.each do |command|
machine.communicate.sudo(command) do |type, data|
success = false if type == :stderr && data =~ /No such device/i
no_such_device = false
status = machine.communicate.sudo(command, error_check: false) do |type, data|
no_such_device = true if type == :stderr && data =~ /No such device/i
end
success = status == 0 && !no_such_device
break if success
end
break if success
attempts += 1
raise Vagrant::Errors::LinuxMountFailed, :command => mount_command
raise Vagrant::Errors::LinuxMountFailed, :command => mount_commands.join("\n")
sleep 2
end