providers/docker: cleaner reload
This commit is contained in:
parent
12d3e06f69
commit
27cd8886b3
|
@ -111,24 +111,21 @@ module VagrantPlugins
|
||||||
# machine back up with the new configuration.
|
# machine back up with the new configuration.
|
||||||
def self.action_reload
|
def self.action_reload
|
||||||
Vagrant::Action::Builder.new.tap do |b|
|
Vagrant::Action::Builder.new.tap do |b|
|
||||||
|
b.use ConfigValidate
|
||||||
b.use Call, IsState, :not_created do |env, b2|
|
b.use Call, IsState, :not_created do |env, b2|
|
||||||
if env[:result]
|
if !env[:result]
|
||||||
b2.use Message, I18n.t("docker_provider.messages.not_created")
|
b2.use action_halt
|
||||||
next
|
|
||||||
end
|
end
|
||||||
|
|
||||||
b2.use ConfigValidate
|
|
||||||
b2.use action_halt
|
|
||||||
|
|
||||||
b2.use Call, IsBuild do |env2, b3|
|
|
||||||
if env2[:result]
|
|
||||||
b3.use EnvSet, force_confirm_destroy: true
|
|
||||||
b3.use action_destroy.flatten
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
b2.use action_start
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
b.use Call, IsBuild do |env, b2|
|
||||||
|
if env[:result]
|
||||||
|
b2.use EnvSet, force_confirm_destroy: true
|
||||||
|
b2.use action_destroy.flatten
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
b.use action_start
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue