From c238dc0a3541be82f4ef406068f225efcd83417b Mon Sep 17 00:00:00 2001 From: Chris Roberts Date: Fri, 25 May 2018 16:43:17 -0700 Subject: [PATCH] Include machine name when raising invalid box errors --- plugins/providers/hyperv/action/import.rb | 6 +++--- test/unit/plugins/providers/hyperv/action/import_test.rb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/providers/hyperv/action/import.rb b/plugins/providers/hyperv/action/import.rb index bbe19e0c3..25229e3d0 100644 --- a/plugins/providers/hyperv/action/import.rb +++ b/plugins/providers/hyperv/action/import.rb @@ -19,7 +19,7 @@ module VagrantPlugins if !vm_dir.directory? || !hd_dir.directory? @logger.error("Required virtual machine directory not found!") - raise Errors::BoxInvalid + raise Errors::BoxInvalid, name: env[:machine].name end valid_config_ext = [".xml"] @@ -37,7 +37,7 @@ module VagrantPlugins if !config_path @logger.error("Failed to locate box configuration path") - raise Errors::BoxInvalid + raise Errors::BoxInvalid, name: env[:machine].name else @logger.info("Found box configuration path: #{config_path}") end @@ -52,7 +52,7 @@ module VagrantPlugins if !image_path @logger.error("Failed to locate box image path") - raise Errors::BoxInvalid + raise Errors::BoxInvalid, name: env[:machine].name else @logger.info("Found box image path: #{image_path}") end diff --git a/test/unit/plugins/providers/hyperv/action/import_test.rb b/test/unit/plugins/providers/hyperv/action/import_test.rb index 32c68695c..9c66bb0c2 100644 --- a/test/unit/plugins/providers/hyperv/action/import_test.rb +++ b/test/unit/plugins/providers/hyperv/action/import_test.rb @@ -8,7 +8,7 @@ describe VagrantPlugins::HyperV::Action::Import do let(:ui){ double("ui") } let(:provider){ double("provider", driver: driver) } let(:driver){ double("driver") } - let(:machine){ double("machine", provider: provider, provider_config: provider_config, box: box, data_dir: data_dir) } + let(:machine){ double("machine", provider: provider, provider_config: provider_config, box: box, data_dir: data_dir, name: "machname") } let(:provider_config){ double("provider_config", linked_clone: false,