diff --git a/plugins/kernel_v2/config/push.rb b/plugins/kernel_v2/config/push.rb index e0137b29d..e1cb95734 100644 --- a/plugins/kernel_v2/config/push.rb +++ b/plugins/kernel_v2/config/push.rb @@ -21,18 +21,18 @@ module VagrantPlugins # Compile all the provider configurations @__defined_pushes.each do |name, tuples| - # Find the configuration class for this push - config_class = Vagrant.plugin("2").manager.push_configs[name] - config_class ||= Vagrant::Config::V2::DummyConfig - - # Load it up - config = config_class.new - # Capture the strategy so we can use it later. This will be used in # the block iteration for merging/overwriting strategy = name strategy = tuples[0][0] if tuples[0] + # Find the configuration class for this push + config_class = Vagrant.plugin("2").manager.push_configs[strategy] + config_class ||= Vagrant::Config::V2::DummyConfig + + # Load it up + config = config_class.new + begin tuples.each do |s, b| # Update the strategy if it has changed, reseting the current diff --git a/plugins/pushes/local-exec/plugin.rb b/plugins/pushes/local-exec/plugin.rb index 9f8be467b..e58fe4bed 100644 --- a/plugins/pushes/local-exec/plugin.rb +++ b/plugins/pushes/local-exec/plugin.rb @@ -8,13 +8,13 @@ module VagrantPlugins Run a local command or script to push DESC - config(:local_exec, :push) do + config(:"local-exec", :push) do require File.expand_path("../config", __FILE__) init! Config end - push(:local_exec) do + push(:"local-exec") do require File.expand_path("../push", __FILE__) init! Push diff --git a/plugins/pushes/local-exec/push.rb b/plugins/pushes/local-exec/push.rb index be74e68d5..bad308f3b 100644 --- a/plugins/pushes/local-exec/push.rb +++ b/plugins/pushes/local-exec/push.rb @@ -1,6 +1,6 @@ require "fileutils" require "tempfile" -require "vagrant/util/subprocess" +require "vagrant/util/safe_exec" require_relative "errors" @@ -38,16 +38,7 @@ module VagrantPlugins # Execute the script, raising an exception if it fails. def execute!(*cmd) - result = Vagrant::Util::Subprocess.execute(*cmd) - - if result.exit_code != 0 - raise Errors::CommandFailed, - cmd: cmd.join(" "), - stdout: result.stdout, - stderr: result.stderr - end - - result + Vagrant::Util::SafeExec.exec(cmd[0], *cmd[1..-1]) end end end