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:
parent
e21fb59380
commit
3a515cc7d6
@ -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
|
||||
|
||||
@ -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|
|
||||