BUG: Solved problems that happened in unit test "VagrantPlugins::HyperV::Action::Configure", "should call the app on success". The problems occured because controllers was being called when it wasn't defined. Solved by implementing if test for this.
This commit is contained in:
parent
e5641c826f
commit
7a44cf58c7
|
@ -17,7 +17,7 @@ module VagrantPlugins
|
|||
def call(env)
|
||||
vm_dir = env[:machine].box.directory.join("Virtual Machines")
|
||||
hd_dir = env[:machine].box.directory.join("Virtual Hard Disks")
|
||||
controllers = env[:machine].provider_config.controllers
|
||||
|
||||
if !vm_dir.directory? || !hd_dir.directory?
|
||||
@logger.error("Required virtual machine directory not found!")
|
||||
raise Errors::BoxInvalid, name: env[:machine].name
|
||||
|
@ -61,6 +61,8 @@ module VagrantPlugins
|
|||
env[:ui].output("Importing a Hyper-V instance")
|
||||
dest_path = env[:machine].data_dir.join("Virtual Hard Disks").join(image_path.basename).to_s
|
||||
|
||||
if defined? env[:machine].provider_config.controllers
|
||||
controllers = env[:machine].provider_config.controllers
|
||||
disks_to_create = []
|
||||
data_dir = env[:machine].data_dir
|
||||
# This can happen when creating new on up.
|
||||
|
@ -89,6 +91,7 @@ module VagrantPlugins
|
|||
}
|
||||
}
|
||||
disks_to_create_json = disks_to_create.to_json.to_s.gsub('"', '"""')
|
||||
end
|
||||
|
||||
options = {
|
||||
"VMConfigFile" => Vagrant::Util::Platform.wsl_to_windows_path(config_path).gsub("/", "\\"),
|
||||
|
|
Loading…
Reference in New Issue