From 4c5262690ebcf4560c2be60636707f377d55edef Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 1 May 2013 18:50:40 -0700 Subject: [PATCH] Ignore "guest not ready" error when graceful halting [GH-1679] --- CHANGELOG.md | 5 +++++ lib/vagrant/action/builtin/graceful_halt.rb | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 35b2cf945..210d15653 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,11 @@ IMPROVEMENTS: - More precise detection of Ubuntu/Debian guests so that running Vagrant within an LXC container works properly now. +BUG FIXES: + + - Ignore "guest not ready" errors when attempting to graceful halt and + carry on checks whether the halt succeeded. [GH-1679] + ## 1.2.2 (April 23, 2013) FEATURES: diff --git a/lib/vagrant/action/builtin/graceful_halt.rb b/lib/vagrant/action/builtin/graceful_halt.rb index da1235551..fc218a94c 100644 --- a/lib/vagrant/action/builtin/graceful_halt.rb +++ b/lib/vagrant/action/builtin/graceful_halt.rb @@ -44,7 +44,12 @@ module Vagrant # checked above. if graceful env[:ui].info I18n.t("vagrant.actions.vm.halt.graceful") - env[:machine].guest.capability(:halt) + + begin + env[:machine].guest.capability(:halt) + rescue Errors::MachineGuestNotReady + @logger.info("Machine guest not ready while attempting to halt. Ignoring.") + end @logger.debug("Waiting for target graceful halt state: #{@target_state}") count = 0