Get box collection from vagrant-go
This commit is contained in:
parent
8ead293836
commit
f71aa68a69
@ -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
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user