Error if the required storage controller not found

This commit adds a new error type that can be raised whenever a storage
controller of the required type is not found. This indicates that a user
needs to either add the storage controller manually or change their disk
configuration.

It also removes the last hardcoded instance of "SATA Controller" as a
default argument.
This commit is contained in:
Jeff Bonhag 2020-06-01 17:24:08 -04:00
parent e21fb59380
commit 3a515cc7d6
No known key found for this signature in database
GPG Key ID: 32966F3FB5AC1129
5 changed files with 78 additions and 23 deletions

View File

@ -932,6 +932,10 @@ module Vagrant
error_key(:virtualbox_disks_defined_exceed_limit)
end
class VirtualBoxDisksControllerNotFound < VagrantError
error_key(:virtualbox_disks_controller_not_found)
end
class VirtualBoxGuestPropertyNotFound < VagrantError
error_key(:virtualbox_guest_property_not_found)
end

View File

@ -29,7 +29,7 @@ module VagrantPlugins
controller = machine.provider.driver.storage_controllers.detect { |c| c.sata_controller? }
primary_disk = controller.attachments.detect { |a| a[:port] == "0" && a[:device] == "0" }[:uuid]
unless disk_meta.nil?
if disk_meta
disk_meta.each do |d|