providers/docker: raise better error for local executor
This commit is contained in:
parent
76e337a0d4
commit
013fc729a5
|
@ -17,15 +17,17 @@ module VagrantPlugins
|
||||||
Vagrant::Util::Subprocess.execute(*cmd, &block)
|
Vagrant::Util::Subprocess.execute(*cmd, &block)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
result.stderr.gsub!("\r\n", "\n")
|
||||||
|
result.stdout.gsub!("\r\n", "\n")
|
||||||
|
|
||||||
if result.exit_code != 0 && !interrupted
|
if result.exit_code != 0 && !interrupted
|
||||||
msg = result.stdout.gsub("\r\n", "\n")
|
raise Errors::ExecuteError,
|
||||||
msg << result.stderr.gsub("\r\n", "\n")
|
command: command.inspect,
|
||||||
raise "#{cmd.inspect}\n#{msg}" #Errors::ExecuteError, :command => command.inspect
|
stderr: result.stderr,
|
||||||
|
stdout: result.stdout
|
||||||
end
|
end
|
||||||
|
|
||||||
# Return the output, making sure to replace any Windows-style
|
result.stdout
|
||||||
# newlines with Unix-style.
|
|
||||||
result.stdout.gsub("\r\n", "\n")
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue