Use remote machine/environment

This commit is contained in:
sophia 2022-01-19 14:04:49 -06:00 committed by Paul Hinze
parent 5ed50277bd
commit 2469016be1
No known key found for this signature in database
GPG Key ID: B69DEDF2D55501C0
3 changed files with 10 additions and 12 deletions

View File

@ -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)

View File

@ -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

View File

@ -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 == ""