SOLR-14237: Fix HDFS nightly test failure

This commit is contained in:
Ishan Chattopadhyaya 2020-04-30 21:04:08 +05:30
parent 26c9fce5db
commit 9ed5b6a218
1 changed files with 9 additions and 3 deletions

View File

@ -323,8 +323,14 @@ public class SystemInfoHandler extends RequestHandlerBase
{
SimpleOrderedMap<Object> info = new SimpleOrderedMap<>();
if (cc.getAuthenticationPlugin() != null) info.add("authenticationPlugin", cc.getAuthenticationPlugin().getName());
if (cc.getAuthorizationPlugin() != null) info.add("authorizationPlugin", cc.getAuthorizationPlugin().getClass().getName());
if (cc != null) {
if (cc.getAuthenticationPlugin() != null) {
info.add("authenticationPlugin", cc.getAuthenticationPlugin().getName());
}
if (cc.getAuthorizationPlugin() != null) {
info.add("authorizationPlugin", cc.getAuthorizationPlugin().getClass().getName());
}
}
// User principal
String username = null;
@ -333,7 +339,7 @@ public class SystemInfoHandler extends RequestHandlerBase
info.add("username", username);
// Mapped roles for this principal
AuthorizationPlugin auth = cc.getAuthorizationPlugin();
AuthorizationPlugin auth = cc==null? null: cc.getAuthorizationPlugin();
if (auth != null) {
RuleBasedAuthorizationPlugin rbap = (RuleBasedAuthorizationPlugin) auth;
Set<String> roles = rbap.getRoles(username);