Preserve returning environment after machine action gets called
This commit is contained in:
parent
48b7c682ad
commit
616b0f9ba6
|
@ -188,7 +188,7 @@ module Vagrant
|
||||||
locker = @env.method(:lock) if 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
|
# Lock this machine for the duration of this action
|
||||||
locker.call("machine-action-#{id}") do
|
return_env = locker.call("machine-action-#{id}") do
|
||||||
# Get the callable from the provider.
|
# Get the callable from the provider.
|
||||||
callable = @provider.action(name)
|
callable = @provider.action(name)
|
||||||
|
|
||||||
|
@ -208,6 +208,8 @@ module Vagrant
|
||||||
end
|
end
|
||||||
|
|
||||||
@triggers.fire_triggers(name, :after, @name.to_s)
|
@triggers.fire_triggers(name, :after, @name.to_s)
|
||||||
|
# preserve returning environment after machine action runs
|
||||||
|
return return_env
|
||||||
rescue Errors::EnvironmentLockedError
|
rescue Errors::EnvironmentLockedError
|
||||||
raise Errors::MachineActionLockedError,
|
raise Errors::MachineActionLockedError,
|
||||||
action: name,
|
action: name,
|
||||||
|
|
Loading…
Reference in New Issue