Repository: ambari Updated Branches: refs/heads/trunk 84c4b434e -> 348ebeaba
AMBARI-6940 Cluster deployment fails if api.authenticate=false (dsen) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/348ebeab Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/348ebeab Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/348ebeab Branch: refs/heads/trunk Commit: 348ebeabaaef566c1502e7b28c546e00d9f27d5e Parents: 84c4b43 Author: Dmytro Sen <d...@hortonworks.com> Authored: Wed Aug 20 17:16:05 2014 +0300 Committer: Dmytro Sen <d...@hortonworks.com> Committed: Wed Aug 20 17:16:05 2014 +0300 ---------------------------------------------------------------------- .../org/apache/ambari/server/state/cluster/ClustersImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/348ebeab/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java b/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java index c27797e..2af3d23 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/state/cluster/ClustersImpl.java +++ b/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); } /**