halt: check that machine is running before attempting to clear tmpfiles
Otherwise, running `vagrant halt` on a stopped machine would make us crash. Particularly annoying in multi-machines environments. ref #406
This commit is contained in:
parent
6738febaa2
commit
582e3b368a
1 changed files with 3 additions and 1 deletions
|
@ -125,7 +125,9 @@ module Vagrant
|
|||
end
|
||||
|
||||
b2.use ClearForwardedPorts
|
||||
b2.use RemoveTemporaryFiles
|
||||
if env[:machine].state.id == :running
|
||||
b2.use RemoveTemporaryFiles
|
||||
end
|
||||
b2.use GcPrivateNetworkBridges
|
||||
b2.use Builtin::Call, Builtin::GracefulHalt, :stopped, :running do |env2, b3|
|
||||
if !env2[:result]
|
||||
|
|
Loading…
Reference in a new issue