diff --git a/lib/vagrant/box_collection/remote.rb b/lib/vagrant/box_collection/remote.rb index a2f3f4dd2..7644b991d 100644 --- a/lib/vagrant/box_collection/remote.rb +++ b/lib/vagrant/box_collection/remote.rb @@ -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 diff --git a/lib/vagrant/environment/remote.rb b/lib/vagrant/environment/remote.rb index 51fe42ea3..c52300502 100644 --- a/lib/vagrant/environment/remote.rb +++ b/lib/vagrant/environment/remote.rb @@ -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] diff --git a/plugins/commands/serve/client/project.rb b/plugins/commands/serve/client/project.rb index 368dec1ce..2f677b294 100644 --- a/plugins/commands/serve/client/project.rb +++ b/plugins/commands/serve/client/project.rb @@ -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