HDDS-796. Fix failed test TestStorageContainerManagerHttpServer#testHttpPolicy.

This commit is contained in:
Yiqun Lin 2018-11-05 17:31:06 +08:00
parent d43cc5db0f
commit 15df2e7a75

View File

@ -115,13 +115,10 @@ protected InetSocketAddress getBindAddress(String bindHostKey,
final Optional<Integer> addressPort =
getPortNumberFromConfigKeys(conf, addressKey);
final Optional<String> addresHost =
final Optional<String> addressHost =
getHostNameFromConfigKeys(conf, addressKey);
String hostName = bindHost.orElse(addresHost.get());
if (hostName == null || hostName.isEmpty()) {
hostName = bindHostDefault;
}
String hostName = bindHost.orElse(addressHost.orElse(bindHostDefault));
return NetUtils.createSocketAddr(
hostName + ":" + addressPort.orElse(bindPortdefault));