Skip to content

Commit

Permalink
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/miq_environment.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@ def self.arch
#
def self.fully_qualified_domain_name
hostname = Socket.gethostname
addrinfo = Addrinfo.getaddrinfo(hostname, nil).first
addrinfo = Addrinfo.getaddrinfo(hostname, nil, nil, :STREAM).first
fqdn, _port = addrinfo.getnameinfo
fqdn
end
2 changes: 1 addition & 1 deletion spec/models/miq_server/environment_manager_spec.rb
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
require "uuidtools"
allow(UUIDTools::UUID).to receive(:mac_address).and_return(mac_address)
allow(Socket).to receive(:gethostname).and_return("localhost")
allow(Addrinfo).to receive(:getaddrinfo).with("localhost", nil).and_return([Addrinfo.tcp("localhost", nil), Addrinfo.udp("localhost", nil)])
allow(Addrinfo).to receive(:getaddrinfo).with("localhost", nil, nil, :STREAM).and_return([Addrinfo.tcp("localhost", nil)])
allow(Socket).to receive(:ip_address_list).and_return([Addrinfo.ip(ip_address)])
end

0 comments on commit ee3babf

Please sign in to comment.