mirror of
https://github.com/hashicorp/vagrant.git
synced 2026-05-28 04:36:05 -04:00
Hacks to let a remote machine be instantiated with or with out a client
This commit is contained in:
parent
a40d890f74
commit
e020c6600e
4 changed files with 12 additions and 3 deletions
|
|
@ -105,6 +105,14 @@ module Vagrant
|
|||
client.default_provider.to_sym
|
||||
end
|
||||
|
||||
# Gets a target (machine) by name
|
||||
#
|
||||
# @param [String] machine name
|
||||
# return [VagrantPlugins::CommandServe::Client::Machine]
|
||||
def get_target(name)
|
||||
client.target(name)
|
||||
end
|
||||
|
||||
# Returns the host object associated with this environment.
|
||||
#
|
||||
# @return [Class]
|
||||
|
|
|
|||
|
|
@ -60,8 +60,8 @@ module Vagrant
|
|||
@name = name
|
||||
@ui_mutex = Mutex.new
|
||||
@state_mutex = Mutex.new
|
||||
# TODO: pass in trigger config (@config.trigger)
|
||||
@triggers = Vagrant::Plugin::V2::Trigger.new(@env, nil, self, @ui)
|
||||
# TODO: get trigger config from go
|
||||
@triggers = Vagrant::Plugin::V2::Trigger.new(@env, @config.trigger, self, @ui)
|
||||
|
||||
# If the ID is the special not created ID, then set our ID to
|
||||
# nil so that we destroy all our data.
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ module VagrantPlugins
|
|||
|
||||
def converter(target)
|
||||
m = target.to_machine
|
||||
Vagrant::Machine.new(client=m)
|
||||
Vagrant::Machine.new(nil, nil, nil, {}, {}, nil, nil, nil, nil, nil, base=false, client=m)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@ describe Vagrant::Machine::Remote do
|
|||
|
||||
|
||||
before do
|
||||
allow(env).to receive(:get_target) { client }
|
||||
allow(client).to receive(:box) { box }
|
||||
allow(client).to receive(:data_dir) { data_dir }
|
||||
allow(client).to receive(:name) { name }
|
||||
|
|
|
|||
Loading…
Reference in a new issue