From 2cf146cf6bd1a9129b4a3f7f897dd3e66ac66a7b Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Mon, 13 Feb 2012 17:39:18 -0800 Subject: [PATCH] Set uuid directly if VM couldn't be found. [GH-725] This fixes a rare edge case where an exception could actually cause Vagrant to remove the UUID state of a running VM, "losing" it. --- CHANGELOG.md | 2 ++ lib/vagrant/vm.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 30d18e651..7a8b4b122 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,8 @@ - Unix-style line endings are used properly for guest OS. [GH-727] - Retry certain VirtualBox operations, since they intermittently fail. [GH-726] + - Fix issue where Vagrant would sometimes "lose" a VM if an exception + occurred. [GH-725] ## 0.9.7 (February 9, 2012) diff --git a/lib/vagrant/vm.rb b/lib/vagrant/vm.rb index 93f73f224..db00647b6 100644 --- a/lib/vagrant/vm.rb +++ b/lib/vagrant/vm.rb @@ -131,7 +131,7 @@ module Vagrant # Clear the UUID since this VM doesn't exist. Note that this calls # back into `reload!` but shouldn't ever result in infinite # recursion since `@uuid` will be nil. - self.uuid = nil + @uuid = nil end end