From 013fc729a5c12ed15ff66b0011c9788f6d0f17de Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 29 Apr 2014 14:16:24 -0700 Subject: [PATCH] providers/docker: raise better error for local executor --- plugins/providers/docker/executor/local.rb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/plugins/providers/docker/executor/local.rb b/plugins/providers/docker/executor/local.rb index 033155c28..5393a868a 100644 --- a/plugins/providers/docker/executor/local.rb +++ b/plugins/providers/docker/executor/local.rb @@ -17,15 +17,17 @@ module VagrantPlugins Vagrant::Util::Subprocess.execute(*cmd, &block) end + result.stderr.gsub!("\r\n", "\n") + result.stdout.gsub!("\r\n", "\n") + if result.exit_code != 0 && !interrupted - msg = result.stdout.gsub("\r\n", "\n") - msg << result.stderr.gsub("\r\n", "\n") - raise "#{cmd.inspect}\n#{msg}" #Errors::ExecuteError, :command => command.inspect + raise Errors::ExecuteError, + command: command.inspect, + stderr: result.stderr, + stdout: result.stdout end - # Return the output, making sure to replace any Windows-style - # newlines with Unix-style. - result.stdout.gsub("\r\n", "\n") + result.stdout end end end