From 214a79e057921509e2d4e2e191d7a7b1aa96bd92 Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Sun, 14 Dec 2014 23:32:32 -0500 Subject: [PATCH] Pushes are hashed by name, not strategy. @mitchellh this is a partial revert of 84ae22e. It took me a little bit to figure out why this broke everything, but then I finally realized it. 84ae22e changes the finalize! function to lookup pushes by strategy type, but pushes are keyed by push strategy name. In other words, given: config.push.define("foo", strategy: "bar") the `push_configs` has will look like: { :foo => [:bar, #] } This is important, because if we key by strategy, the user cannot specify the same push strategy more than once: config.push.define("foo", strategy: "bar") config.push.define("zip", strategy: "bar") If we keyed off of the strategy, this would be impossible. --- plugins/kernel_v2/config/push.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/plugins/kernel_v2/config/push.rb b/plugins/kernel_v2/config/push.rb index e1cb95734..e0137b29d 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| - # 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.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] + begin tuples.each do |s, b| # Update the strategy if it has changed, reseting the current