Revert "AMBARI-20628. Ambari doesn't set properties correctly (magyari_sandor)"
This reverts commit 9741236f3c8b4a8a293fa0b7db5c64c0e7aa704d. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ef34cb4e Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ef34cb4e Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ef34cb4e Branch: refs/heads/branch-feature-AMBARI-12556 Commit: ef34cb4ee57c58687ba7db7adfbb5960c0b267da Parents: 64e88e0 Author: Sandor Magyari <smagy...@hortonworks.com> Authored: Wed Apr 12 20:24:53 2017 +0200 Committer: Sandor Magyari <smagy...@hortonworks.com> Committed: Wed Apr 12 20:24:53 2017 +0200 ---------------------------------------------------------------------- .../stackadvisor/StackAdvisorBlueprintProcessor.java | 8 ++------ .../stackadvisor/StackAdvisorBlueprintProcessorTest.java | 4 ++-- 2 files changed, 4 insertions(+), 8 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/ef34cb4e/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java index b7eca71..0abcc14 100644 --- a/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java +++ b/ambari-server/src/main/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessor.java @@ -175,11 +175,7 @@ public class StackAdvisorBlueprintProcessor { Preconditions.checkArgument(response.getRecommendations().getBlueprint().getConfigurations() != null, "Configurations are missing from the recommendation blueprint response."); - Map<String, Map<String, String>> userProvidedProperties = existingConfigurations; - if (topology.getConfigRecommendationStrategy() == ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY) { - userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations); - } - + Map<String, Map<String, String>> userProvidedProperties = getUserProvidedProperties(topology, existingConfigurations); Map<String, BlueprintConfigurations> recommendedConfigurations = response.getRecommendations().getBlueprint().getConfigurations(); for (Map.Entry<String, BlueprintConfigurations> configEntry : recommendedConfigurations.entrySet()) { @@ -187,7 +183,7 @@ public class StackAdvisorBlueprintProcessor { BlueprintConfigurations blueprintConfig = filterBlueprintConfig(configType, configEntry.getValue(), userProvidedProperties, topology); topology.getAdvisedConfigurations().put(configType, new AdvisedConfiguration( - blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); + blueprintConfig.getProperties(), blueprintConfig.getPropertyAttributes())); } } http://git-wip-us.apache.org/repos/asf/ambari/blob/ef34cb4e/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java index 3febd48..49f070a 100644 --- a/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java +++ b/ambari-server/src/test/java/org/apache/ambari/server/api/services/stackadvisor/StackAdvisorBlueprintProcessorTest.java @@ -114,7 +114,7 @@ public class StackAdvisorBlueprintProcessorTest { expect(clusterTopology.getAdvisedConfigurations()).andReturn(advisedConfigurations).anyTimes(); expect(clusterTopology.getConfiguration()).andReturn(configuration).anyTimes(); expect(clusterTopology.isClusterKerberosEnabled()).andReturn(false).anyTimes(); - expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY).anyTimes(); + expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY); expect(blueprint.getStack()).andReturn(stack).anyTimes(); expect(stack.getVersion()).andReturn("2.3").anyTimes(); expect(stack.getName()).andReturn("HDP").anyTimes(); @@ -149,7 +149,7 @@ public class StackAdvisorBlueprintProcessorTest { expect(clusterTopology.getAdvisedConfigurations()).andReturn(advisedConfigurations).anyTimes(); expect(clusterTopology.getConfiguration()).andReturn(configuration).anyTimes(); expect(clusterTopology.isClusterKerberosEnabled()).andReturn(false).anyTimes(); - expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY).anyTimes(); + expect(clusterTopology.getConfigRecommendationStrategy()).andReturn(ConfigRecommendationStrategy.ONLY_STACK_DEFAULTS_APPLY); expect(blueprint.getStack()).andReturn(stack).anyTimes(); expect(stack.getVersion()).andReturn("2.3").anyTimes(); expect(stack.getName()).andReturn("HDP").anyTimes();