ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleew...@apache.org
Subject [06/50] ambari git commit: AMBARI-20288. Cluster deployment using blueprint with empty configuration doesn't work with stack advisor enabled (Amruta Borkar via alejandro)
Date Fri, 10 Mar 2017 20:46:34 GMT
AMBARI-20288. Cluster deployment using blueprint with empty configuration doesn't work with
stack advisor enabled (Amruta Borkar via alejandro)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dd0bf23f
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dd0bf23f
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dd0bf23f

Branch: refs/heads/branch-dev-logsearch
Commit: dd0bf23f1c12624f378ad25be6f74d2d1ad2dee8
Parents: 8d3d07a
Author: Alejandro Fernandez <afernandez@hortonworks.com>
Authored: Wed Mar 8 16:56:31 2017 -0800
Committer: Alejandro Fernandez <afernandez@hortonworks.com>
Committed: Wed Mar 8 16:56:31 2017 -0800

----------------------------------------------------------------------
 .../internal/BlueprintConfigurationProcessor.java         |  5 +++--
 .../internal/BlueprintConfigurationProcessorTest.java     | 10 +++++++++-
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/dd0bf23f/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
index d4880b9..5732a1c 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessor.java
@@ -638,8 +638,9 @@ public class BlueprintConfigurationProcessor {
       for (Map.Entry<String, ValueAttributesInfo> valueAttrEntry :
         advisedConfig.getPropertyValueAttributes().entrySet()) {
         if ("true".equalsIgnoreCase(valueAttrEntry.getValue().getDelete())) {
-          configuration.removeProperty(configType, valueAttrEntry.getKey());
-          configTypesUpdated.add(configType);
+          if(null != configuration.removeProperty(configType, valueAttrEntry.getKey())) {
+            configTypesUpdated.add(configType);
+          }
         }
       }
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/dd0bf23f/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
index 928d1e0..d160050 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/controller/internal/BlueprintConfigurationProcessorTest.java
@@ -6352,6 +6352,8 @@ public class BlueprintConfigurationProcessorTest {
     Map<String, String> dummySiteMap = new HashMap<String, String>();
     properties.put("dummy-site", dummySiteMap);
     dummySiteMap.put("dummy.prop", "dummyValue");
+    Map<String, String> dummy2SiteMap = new HashMap<String, String>();
+    properties.put("dummy2-site", dummy2SiteMap);
 
     Map<String, Map<String, String>> parentProperties = new HashMap<String,
Map<String, String>>();
 
@@ -6389,8 +6391,9 @@ public class BlueprintConfigurationProcessorTest {
     assertNull(clusterConfig.getPropertyValue("core-site", "fs.stackDefault.key2"));
     // verify that fs.notStackDefault is not filtered out
     assertNotNull(clusterConfig.getPropertyValue("core-site", "fs.notStackDefault"));
-    assertEquals(2, topology.getAdvisedConfigurations().size());
+    assertEquals(3, topology.getAdvisedConfigurations().size());
     assertFalse(configTypes.contains("dummy-site"));
+    assertFalse(configTypes.contains("dummy2-site"));
   }
 
   @Test
@@ -7981,6 +7984,11 @@ public class BlueprintConfigurationProcessorTest {
     Map<String, String> dummyConfProp = new HashMap<String, String>();
     dummyConfProp.put("dummy.prop", "dummyValue");
     advMap.put("dummy-site", new AdvisedConfiguration(dummyConfProp, new HashMap<String,
ValueAttributesInfo>()));
+    Map<String, ValueAttributesInfo> dummy2attrMap = new HashMap<String, ValueAttributesInfo>();
+    ValueAttributesInfo dummy2valInfo = new ValueAttributesInfo();
+    dummy2valInfo.setDelete("true");
+    dummy2attrMap.put("dummy2.property", dummy2valInfo);
+    advMap.put("dummy2-site", new AdvisedConfiguration(new HashMap<String, String>(),
dummy2attrMap));
     return advMap;
   }
 


Mime
View raw message