providers/docker: cleaner action stacks
This commit is contained in:
parent
35d9256137
commit
d1b3165545
|
@ -9,8 +9,25 @@ module VagrantPlugins
|
|||
def self.action_up
|
||||
Vagrant::Action::Builder.new.tap do |b|
|
||||
b.use ConfigValidate
|
||||
b.use HandleBox
|
||||
|
||||
b.use Call, IsState, :not_created do |env, b2|
|
||||
if env[:result]
|
||||
b2.use HandleBox
|
||||
end
|
||||
end
|
||||
|
||||
b.use HostMachine
|
||||
|
||||
# Yeah, this is supposed to be here twice (once more above). This
|
||||
# catches the case when the container was supposed to be created,
|
||||
# but the host state was unknown, and now we know its not actually
|
||||
# created.
|
||||
b.use Call, IsState, :not_created do |env, b2|
|
||||
if env[:result]
|
||||
b2.use HandleBox
|
||||
end
|
||||
end
|
||||
|
||||
b.use action_start
|
||||
end
|
||||
end
|
||||
|
|
|
@ -141,7 +141,9 @@ module VagrantPlugins
|
|||
|
||||
def state
|
||||
state_id = nil
|
||||
state_id = :host_state_unknown if host_vm? && !host_vm.communicate.ready?
|
||||
state_id = :not_created if !@machine.id
|
||||
state_id = :host_state_unknown if !state_id && \
|
||||
host_vm? && !host_vm.communicate.ready?
|
||||
state_id = :not_created if !state_id && \
|
||||
(!@machine.id || !driver.created?(@machine.id))
|
||||
state_id = driver.state(@machine.id) if @machine.id && !state_id
|
||||
|
|
Loading…
Reference in New Issue