try {
cloudHostName = httpGet(PUBLIC_HOSTNAME_URI);
} catch (IOException ioe) {
String msg = "Unable to get public hostname from instance metadata";
LOG.error(msg, ioe);
throw new GenieServerException(msg, ioe);
}
if (cloudHostName == null || cloudHostName.isEmpty()) {
try {
cloudHostName = httpGet(LOCAL_IPV4_URI);
} catch (final IOException ioe) {
String msg = "Unable to get local IP from instance metadata";
LOG.error(msg, ioe);
throw new GenieServerException(msg, ioe);
}
}
LOG.info("cloudHostName=" + cloudHostName);
return cloudHostName;