From 9ca19cbf2975969f8b3cc4aba7dd046b0aa8e5e7 Mon Sep 17 00:00:00 2001 From: Kirill Shirinkin Date: Sun, 6 Mar 2016 19:14:14 +0100 Subject: [PATCH] Fix handling missing box.img --- lib/vagrant-libvirt/action/handle_box_image.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/vagrant-libvirt/action/handle_box_image.rb b/lib/vagrant-libvirt/action/handle_box_image.rb index 2db7718..e3d6511 100644 --- a/lib/vagrant-libvirt/action/handle_box_image.rb +++ b/lib/vagrant-libvirt/action/handle_box_image.rb @@ -67,7 +67,9 @@ module VagrantPlugins env[:ui].info(I18n.t('vagrant_libvirt.uploading_volume')) # Create new volume in storage pool - raise Errors::BoxNotFound if !File.exists?(box_image_file) + unless File.exists?(box_image_file) + raise Vagrant::Errors::BoxNotFound.new(name: env[:machine].box.name) + end box_image_size = File.size(box_image_file) # B message = "Creating volume #{env[:box_volume_name]}" message << " in storage pool #{config.storage_pool_name}."