diff --git a/lib/vagrant/environment.rb b/lib/vagrant/environment.rb index 9b4d086ed..6d8d79cc9 100644 --- a/lib/vagrant/environment.rb +++ b/lib/vagrant/environment.rb @@ -498,7 +498,8 @@ module Vagrant @host = Host.new( host_klass, Vagrant.plugin("2").manager.hosts, - Vagrant.plugin("2").manager.host_capabilities) + Vagrant.plugin("2").manager.host_capabilities, + self) rescue Errors::CapabilityHostNotDetected # If the auto-detect failed, then we create a brand new host # with no capabilities and use that. This should almost never happen @@ -510,7 +511,7 @@ module Vagrant hosts = { generic: [klass, nil] } host_caps = {} - @host = Host.new(:generic, hosts, host_caps) + @host = Host.new(:generic, hosts, host_caps, self) rescue Errors::CapabilityHostExplicitNotDetected => e raise Errors::HostExplicitNotDetected, e.extra_data end diff --git a/lib/vagrant/host.rb b/lib/vagrant/host.rb index 2321edd83..aa496e314 100644 --- a/lib/vagrant/host.rb +++ b/lib/vagrant/host.rb @@ -9,8 +9,8 @@ module Vagrant class Host include CapabilityHost - def initialize(host, hosts, capabilities) - initialize_capabilities!(host, hosts, capabilities) + def initialize(host, hosts, capabilities, env) + initialize_capabilities!(host, hosts, capabilities, env) end end end diff --git a/test/unit/vagrant/host_test.rb b/test/unit/vagrant/host_test.rb index 63c267e52..9b4c2d40c 100644 --- a/test/unit/vagrant/host_test.rb +++ b/test/unit/vagrant/host_test.rb @@ -7,11 +7,12 @@ describe Vagrant::Host do let(:capabilities) { {} } let(:hosts) { {} } + let(:env) { Object.new } it "initializes the capabilities" do described_class.any_instance.should_receive(:initialize_capabilities!). - with(:foo, hosts, capabilities) + with(:foo, hosts, capabilities, env) - described_class.new(:foo, hosts, capabilities) + described_class.new(:foo, hosts, capabilities, env) end end