Switch to Vagrant::Util methods

This commit is contained in:
Jeff Bonhag 2020-05-29 15:51:24 -04:00
parent e7d48b0b93
commit 73130e3ff6
No known key found for this signature in database
GPG Key ID: 32966F3FB5AC1129
2 changed files with 2 additions and 2 deletions

View File

@ -270,7 +270,7 @@ module Vagrant
else
# Do a regular check
if test_host_ip == "0.0.0.0" || Addrinfo.ip(test_host_ip).ipv4_loopback? ||
ipv4_interfaces.detect { |iface| iface[1] == test_host_ip }
Vagrant::Util::IPv4Interfaces.ipv4_interfaces.detect { |iface| iface[1] == test_host_ip }
Vagrant::Util::IsPortOpen.is_port_open?(test_host_ip, host_port)
else
raise Errors::ForwardPortHostIPNotFound, name: machine.name, host_ip: host_ip

View File

@ -209,7 +209,7 @@ describe Vagrant::Action::Builtin::HandleForwardedPortCollisions do
let (:host_ip) { "127.1.2.40" }
it "should check if the port is open" do
expect(instance).to receive(:is_port_open?).with(host_ip, host_port).and_return(true)
expect(Vagrant::Util::IsPortOpen).to receive(:is_port_open?).with(host_ip, host_port).and_return(true)
instance.send(:port_check, host_ip, host_port)
end
end