瀏覽代碼

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

Dmytro Sen 11 年之前
父節點
當前提交
348ebeabaa
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java

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