providers/docker: don't reload if not created

This commit is contained in:
Mitchell Hashimoto 2014-05-05 22:06:22 -07:00
parent 38d1f0c0aa
commit 337e51c2a6
1 changed files with 13 additions and 10 deletions

View File

@ -114,19 +114,22 @@ module VagrantPlugins
Vagrant::Action::Builder.new.tap do |b|
b.use ConfigValidate
b.use Call, IsState, :not_created do |env, b2|
if !env[:result]
b2.use action_halt
end
end
b.use Call, IsBuild do |env, b2|
if env[:result]
b2.use EnvSet, force_confirm_destroy: true
b2.use action_destroy.flatten
b2.use Message, I18n.t("docker_provider.messages.not_created")
next
end
end
b.use action_start
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
end