Explorar o código

AMBARI-8151. Slider View: /slider/apptypes returns unsecured configs when cluster is secured and ambari-server not restarted (srimanth)

Srimanth Gunturi %!s(int64=10) %!d(string=hai) anos
pai
achega
804fab44b5

+ 6 - 7
contrib/views/slider/src/main/java/org/apache/ambari/view/slider/SliderAppsViewControllerImpl.java

@@ -944,14 +944,13 @@ public class SliderAppsViewControllerImpl implements SliderAppsViewController {
 
   @Override
   public List<SliderAppType> getSliderAppTypes(Set<String> properties) {
-    Map<String, String> hadoopConfigs = getHadoopConfigs();
-    if(hadoopConfigs==null || hadoopConfigs.isEmpty()) {
-      try {
-        // Need to determine security enablement before loading app types
-        getViewStatus();
-      } catch (Throwable t) {
-      }
+    try {
+      // Need to determine security enablement before loading app types
+      getViewStatus();
+    } catch (Throwable t) {
+      logger.warn("Unable to determine if cluster is secured when loading app-types", t);
     }
+    Map<String, String> hadoopConfigs = getHadoopConfigs();
     final boolean securityEnabled = Boolean.valueOf(hadoopConfigs.get("security_enabled"));
     if (appTypes == null) {
       appTypes = loadAppTypes();