Pass all options to host only network creation

This commit is contained in:
Chris Roberts 2022-11-03 11:05:06 -07:00
parent c8a71882d3
commit c0c4b80dcb
2 changed files with 5 additions and 8 deletions

View File

@ -481,10 +481,7 @@ module VagrantPlugins
#-----------------------------------------------------------------
# This creates a host only network for the given configuration.
def hostonly_create_network(config)
@env[:machine].provider.driver.create_host_only_network(
adapter_ip: config[:adapter_ip],
netmask: config[:netmask]
)
@env[:machine].provider.driver.create_host_only_network(config)
end
# This finds a matching host only network for the given configuration.

View File

@ -231,10 +231,10 @@ describe VagrantPlugins::ProviderVirtualBox::Action::Network do
subject.call(env)
expect(driver).to have_received(:create_host_only_network).with({
expect(driver).to have_received(:create_host_only_network).with(hash_including({
adapter_ip: interface_ip,
netmask: 64,
})
}))
expect(guest).to have_received(:capability).with(:configure_networks, [{
type: :static6,
@ -308,10 +308,10 @@ describe VagrantPlugins::ProviderVirtualBox::Action::Network do
subject.call(env)
expect(driver).to have_received(:create_host_only_network).with({
expect(driver).to have_received(:create_host_only_network).with(hash_including({
adapter_ip: '192.168.56.1',
netmask: '255.255.255.0',
})
}))
expect(driver).to have_received(:create_dhcp_server).with('vboxnet0', {
adapter_ip: "192.168.56.1",