Module: Utils

Included in:
ChronosEndpoint, ConsulCluster, MarathonEndpoint, MesosCluster
Defined in:
lib/panteras_api/utils.rb

Class Method Summary collapse

Class Method Details

.fully_qualified_hostnameObject



8
9
10
11
12
13
14
# File 'lib/panteras_api/utils.rb', line 8

def self.fully_qualified_hostname
  begin
    Socket.gethostbyname(Socket.gethostname.strip).first
  rescue SocketError => e
    raise StandardError, "Could not get fully qualified domain name using gethostbyname."
  end
end

.hostnameObject



4
5
6
# File 'lib/panteras_api/utils.rb', line 4

def self.hostname
  Socket.gethostname.strip
end