|
@@ -423,7 +423,7 @@ public final class SecurityUtil {
|
|
*/
|
|
*/
|
|
public static void setTokenService(Token<?> token, InetSocketAddress addr) {
|
|
public static void setTokenService(Token<?> token, InetSocketAddress addr) {
|
|
Text service = buildTokenService(addr);
|
|
Text service = buildTokenService(addr);
|
|
- if (token != null && service != null) {
|
|
|
|
|
|
+ if (token != null) {
|
|
token.setService(service);
|
|
token.setService(service);
|
|
if (LOG.isDebugEnabled()) {
|
|
if (LOG.isDebugEnabled()) {
|
|
LOG.debug("Acquired token "+token); // Token#toString() prints service
|
|
LOG.debug("Acquired token "+token); // Token#toString() prints service
|
|
@@ -443,10 +443,9 @@ public final class SecurityUtil {
|
|
String host = null;
|
|
String host = null;
|
|
if (useIpForTokenService) {
|
|
if (useIpForTokenService) {
|
|
if (addr.isUnresolved()) { // host has no ip address
|
|
if (addr.isUnresolved()) { // host has no ip address
|
|
- LOG.warn("unable to resolve host name " + addr
|
|
|
|
- + ". Failure to construct a correct token service "
|
|
|
|
- + "name may result in operation failures");
|
|
|
|
- return null;
|
|
|
|
|
|
+ throw new IllegalArgumentException(
|
|
|
|
+ new UnknownHostException(addr.getHostName())
|
|
|
|
+ );
|
|
}
|
|
}
|
|
host = addr.getAddress().getHostAddress();
|
|
host = addr.getAddress().getHostAddress();
|
|
} else {
|
|
} else {
|