Mitchell Hashimoto 77cca19b7e Destroy middleware
2010-07-05 19:17:48 +02:00

21 lines
407 B
Ruby

module Vagrant
class Action
module VM
class Destroy
def initialize(app, env)
@app = app
end
def call(env)
env.logger.info "Destroying VM and associated drives..."
env["vm"].vm.destroy(:destroy_medium => :delete)
env["vm"].vm = nil
env.env.update_dotfile
@app.call(env)
end
end
end
end
end