From 2469016be12a06d5da5fa2035ada4b51aecc459e Mon Sep 17 00:00:00 2001 From: sophia Date: Wed, 19 Jan 2022 14:04:49 -0600 Subject: [PATCH] Use remote machine/environment --- lib/vagrant/environment/remote.rb | 4 ++-- lib/vagrant/machine/remote.rb | 16 +++++++--------- lib/vagrant/machine_index/remote.rb | 2 +- 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/lib/vagrant/environment/remote.rb b/lib/vagrant/environment/remote.rb index 12e6012ed..cbea55e42 100644 --- a/lib/vagrant/environment/remote.rb +++ b/lib/vagrant/environment/remote.rb @@ -20,12 +20,12 @@ module Vagrant @logger = Log4r::Logger.new("vagrant::environment") # Set the default ui class - opts[:ui_class] ||= UI::Silent + opts[:ui_class] ||= UI::Remote @cwd = Pathname.new(@client.cwd) @home_path = Pathname.new(@client.home) @vagrantfile_name = [@client.vagrantfile_name] - @ui = opts.fetch(:ui, opts[:ui_class].new) + @ui = opts.fetch(:ui, opts[:ui_class].new(@client.ui)) @local_data_path = Pathname.new(@client.local_data) @boxes_path = @home_path.join("boxes") @data_dir = Pathname.new(@client.data_dir) diff --git a/lib/vagrant/machine/remote.rb b/lib/vagrant/machine/remote.rb index 4be218e75..4ca83e9fd 100644 --- a/lib/vagrant/machine/remote.rb +++ b/lib/vagrant/machine/remote.rb @@ -64,14 +64,16 @@ module Vagrant end # @return [Box] - # def box - # client.get_box - # end + def box + client.box + end + # TODO # def config # raise NotImplementedError, "TODO" # end + # TODO # @return [Pathname] # def data_dir # Pathname.new(client.get_data_dir) @@ -86,6 +88,7 @@ module Vagrant client.name end + # TODO # def index_uuid # client.get_uuid # end @@ -95,12 +98,7 @@ module Vagrant end def state - s = @provider.state - if s != @_cached_state - client.set_machine_state(s) unless s.nil? - @_cached_state = s - end - s + client.machine_state end def provider diff --git a/lib/vagrant/machine_index/remote.rb b/lib/vagrant/machine_index/remote.rb index 870761d14..acf91e702 100644 --- a/lib/vagrant/machine_index/remote.rb +++ b/lib/vagrant/machine_index/remote.rb @@ -38,7 +38,7 @@ module Vagrant @updated_at = raw["updated_at"] @extra_data = raw["extra_data"] || {} - @machine_client = raw["machine_client"] + @machine_client = raw["machine"] # Be careful with the paths @local_data_path = nil if @local_data_path == ""