From 27cd8886b33b666ec71a278ebd27d1e81ff00916 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Sun, 27 Apr 2014 19:27:11 -0700 Subject: [PATCH] providers/docker: cleaner reload --- plugins/providers/docker/action.rb | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/plugins/providers/docker/action.rb b/plugins/providers/docker/action.rb index 80be9e2f1..5d635b875 100644 --- a/plugins/providers/docker/action.rb +++ b/plugins/providers/docker/action.rb @@ -111,24 +111,21 @@ module VagrantPlugins # machine back up with the new configuration. def self.action_reload Vagrant::Action::Builder.new.tap do |b| + b.use ConfigValidate b.use Call, IsState, :not_created do |env, b2| - if env[:result] - b2.use Message, I18n.t("docker_provider.messages.not_created") - next + if !env[:result] + b2.use action_halt 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 + + 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