Просмотр исходного кода

AMBARI-6940 Cluster deployment fails if api.authenticate=false (dsen)

Dmytro Sen 11 лет назад
Родитель
Сommit
348ebeabaa

+ 5 - 1
ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java

@@ -28,6 +28,7 @@ import org.apache.ambari.server.DuplicateResourceException;
 import org.apache.ambari.server.HostNotFoundException;
 import org.apache.ambari.server.agent.DiskInfo;
 import org.apache.ambari.server.api.services.AmbariMetaInfo;
+import org.apache.ambari.server.configuration.Configuration;
 import org.apache.ambari.server.orm.dao.ClusterDAO;
 import org.apache.ambari.server.orm.dao.ConfigGroupHostMappingDAO;
 import org.apache.ambari.server.orm.dao.HostDAO;
@@ -101,6 +102,8 @@ public class ClustersImpl implements Clusters {
   @Inject
   HostFactory hostFactory;
   @Inject
+  Configuration configuration;
+  @Inject
   AmbariMetaInfo ambariMetaInfo;
   @Inject
   Gson gson;
@@ -707,7 +710,8 @@ public class ClustersImpl implements Clusters {
       // do nothing
     }
 
-    return (cluster == null && readOnly) || checkPermission(cluster, readOnly);
+    return (cluster == null && readOnly) || !configuration.getApiAuthentication()
+      || checkPermission(cluster, readOnly);
   }
 
   /**