Return list of box info when requesting all boxes

This commit is contained in:
sophia 2021-11-15 15:21:41 -06:00 committed by Paul Hinze
parent 9e04d926bf
commit 69b15f7140
No known key found for this signature in database
GPG key ID: B69DEDF2D55501C0
2 changed files with 8 additions and 3 deletions

View file

@ -33,7 +33,12 @@ module Vagrant
# @return [Array] Array of `[name, version, provider]` of the boxes
# installed on this system.
def all
client.all
all_boxes = client.all
boxes = []
all_boxes.each do |b|
boxes << [b.name, b.version, b.provider]
end
boxes
end
# @return [Box] The box found, or `nil` if not found.

View file

@ -46,9 +46,9 @@ module VagrantPlugins
end
# @return [Vagrant::Box] box found
def find(name, providers, versions)
def find(name, providers, version)
res = client.find(SDK::BoxCollection::FindRequest.new(
name: name, version: version, providers: providers
name: name, version: version, providers: Array(providers)
))
box_client = Box.load(res, broker: broker)
box = Vagrant::Box.new(