AMBARI-14043. BE: Disallow to add the same host to different CG of the same service. (mpapirkovskyy)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dffd7760 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dffd7760 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dffd7760 Branch: refs/heads/trunk Commit: dffd7760fb3bb93746546e86f1c8cdaaa3c9906d Parents: 36dc7a0 Author: Myroslav Papirkovskyy <mpapyrkovs...@hortonworks.com> Authored: Tue Nov 24 17:09:09 2015 +0200 Committer: Myroslav Papirkovskyy <mpapyrkovs...@hortonworks.com> Committed: Tue Nov 24 19:04:43 2015 +0200 ---------------------------------------------------------------------- .../server/controller/internal/ConfigGroupResourceProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/dffd7760/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java index 2642792..14a16c1 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/ConfigGroupResourceProvider.java @@ -395,7 +395,7 @@ public class ConfigGroupResourceProvider extends && !configGroup.getId().equals(request.getId())) { // Check the new host list for duplicated with this group for (Host host : hosts.values()) { - if (configGroup.getHosts().containsKey(host.getHostName())) { + if (configGroup.getHosts().containsKey(host.getHostId())) { throw new DuplicateResourceException("Host is already " + "associated with a config group" + ", clusterName = " + configGroup.getClusterName()