From cb6f3e526a0ef868835bda9b4135710589e82172 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Fri, 24 Oct 2014 15:51:52 -0700 Subject: [PATCH] Fix failing test --- lib/vagrant/machine.rb | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/vagrant/machine.rb b/lib/vagrant/machine.rb index 6adb5a793..4950bbdf6 100644 --- a/lib/vagrant/machine.rb +++ b/lib/vagrant/machine.rb @@ -144,11 +144,15 @@ module Vagrant # @param [Hash] extra_env This data will be passed into the action runner # as extra data set on the environment hash for the middleware # runner. - def action(name, extra_env=nil, **opts) + def action(name, **opts) @logger.info("Calling action: #{name} on provider #{@provider}") - # Default to locking - opts[:lock] = true if !opts.has_key?(:lock) + # Determine whether we lock or not + lock = true + lock = opts.delete(:lock) if opts.has_key?(:lock) + + # Extra env keys are the remaining opts + extra_env = opts.dup # Create a deterministic ID for this machine vf = nil @@ -160,7 +164,7 @@ module Vagrant # we will want to do more fine-grained unlocking in actions themselves # but for a 1.6.2 release this will work. locker = Proc.new { |*args, &block| block.call } - locker = @env.method(:lock) if opts[:lock] && !name.to_s.start_with?("ssh") + locker = @env.method(:lock) if lock && !name.to_s.start_with?("ssh") # Lock this machine for the duration of this action locker.call("machine-action-#{id}") do