From 157db39938d36e977c1d9f71bc4b30b2b2bae8fe Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Wed, 11 Nov 2020 09:56:03 -0800 Subject: [PATCH] Remove action name tracking for applying The raw action name tracking should be sufficient for preventing multi-insertions where only a single modification should occur. With action name, hooks _should_ be able to be applied in multiple builder stacks as they are expanding. Fixes #12035 --- lib/vagrant/action/builder.rb | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/lib/vagrant/action/builder.rb b/lib/vagrant/action/builder.rb index 1c5ba8592..33eeee2c2 100644 --- a/lib/vagrant/action/builder.rb +++ b/lib/vagrant/action/builder.rb @@ -173,23 +173,16 @@ module Vagrant # be modified builder = self.dup - if env[:builder_applied] != env[:action_name] - apply_action_name = true - env[:builder_applied] = env[:action_name] - end - # Apply all dynamic modifications of the stack. This # will generate dynamic hooks for all actions within # the stack, load any triggers for action classes, and # apply them to the builder's stack builder.apply_dynamic_updates(env) - if apply_action_name - # Now that the stack is fully expanded, apply any - # action hooks that may be defined so they are on - # the outermost locations of the stack - builder.apply_action_name(env) - end + # Now that the stack is fully expanded, apply any + # action hooks that may be defined so they are on + # the outermost locations of the stack + builder.apply_action_name(env) # Wrap the middleware stack with the Warden to provide a consistent # and predictable behavior upon exceptions.