From 99f7b62c83dcf19f02970fcc52c638c06d5a297e Mon Sep 17 00:00:00 2001 From: John Bender Date: Thu, 29 Jul 2010 20:40:35 -0700 Subject: [PATCH] first middleware, import, moved to rescue for cleanup --- lib/vagrant/action/vm/import.rb | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/vagrant/action/vm/import.rb b/lib/vagrant/action/vm/import.rb index 25b4a709f..3bd633a2b 100644 --- a/lib/vagrant/action/vm/import.rb +++ b/lib/vagrant/action/vm/import.rb @@ -22,10 +22,12 @@ module Vagrant end # Import completed successfully. Continue the chain - @app.call(env) if !env.error? - + @app.call(env) + end + + def rescue(env) # Interrupted, destroy the VM - env["actions"].run(:destroy) if env.interrupted? + env["actions"].run(:destroy) end end end