Get box collection from vagrant-go

This commit is contained in:
sophia 2021-11-15 11:54:58 -06:00 committed by Paul Hinze
parent 8ead293836
commit f71aa68a69
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
3 changed files with 16 additions and 2 deletions

View File

@ -17,8 +17,6 @@ module Vagrant
raise ArgumentError,
"Remote client is required for `#{self.class.name}'"
end
@directory = directory
@hook = options[:hook]
@logger = Log4r::Logger.new("vagrant::box_collection")
end

View File

@ -68,6 +68,14 @@ module Vagrant
hook(:environment_load, runner: Action::Runner.new(env: self))
end
# Returns the collection of boxes for the environment.
#
# @return [BoxCollection]
def boxes
box_colletion_client = client.boxes
@_boxes ||= BoxCollection.new(nil, client: box_colletion_client)
end
# Returns the host object associated with this environment.
#
# @return [Class]

View File

@ -5,6 +5,14 @@ module VagrantPlugins
prepend Util::ClientSetup
prepend Util::HasLogger
# return [VagrantPlugins::CommandServe::Client::BoxCollection]
def boxes
BoxCollection.load(
client.boxes(Empty.new),
broker: broker
)
end
# return [String]
def cache_dir
data_dirs.cache_dir