ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [2/8] ambari git commit: AMBARI-14696. It failed to change the host name from lower to upper case for the cluster.(vbrodetskyi)
Date Sat, 16 Jan 2016 14:47:38 GMT
AMBARI-14696. It failed to change the host name from lower to upper case for the cluster.(vbrodetskyi)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9e4708876db6d6cc7fbaab4fdba3b87b1ba3e660
Parents: a329199
Author: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Authored: Fri Jan 15 20:41:32 2016 +0200
Committer: Vitaly Brodetskyi <vbrodetskyi@hortonworks.com>
Committed: Fri Jan 15 20:41:32 2016 +0200

----------------------------------------------------------------------
 .../org/apache/ambari/server/update/HostUpdateHelper.java     | 2 +-
 .../org/apache/ambari/server/update/HostUpdateHelperTest.java | 7 ++++---
 2 files changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9e470887/ambari-server/src/main/java/org/apache/ambari/server/update/HostUpdateHelper.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/java/org/apache/ambari/server/update/HostUpdateHelper.java
b/ambari-server/src/main/java/org/apache/ambari/server/update/HostUpdateHelper.java
index 44a45f9..0178f07 100644
--- a/ambari-server/src/main/java/org/apache/ambari/server/update/HostUpdateHelper.java
+++ b/ambari-server/src/main/java/org/apache/ambari/server/update/HostUpdateHelper.java
@@ -356,7 +356,7 @@ public class HostUpdateHelper {
     for (Map.Entry<String, Map<String,String>> clusterHosts : hostChangesFileMap.entrySet())
{
       Map<String,String> newHostPairs = new HashMap<>();
       for (Map.Entry<String, String> hostPair : clusterHosts.getValue().entrySet())
{
-        newHostPairs.put(hostPair.getKey().toLowerCase(), hostPair.getValue());
+        newHostPairs.put(hostPair.getKey().toLowerCase(), hostPair.getValue().toLowerCase());
       }
       newHostChangesFileMap.put(clusterHosts.getKey(), newHostPairs);
     }

http://git-wip-us.apache.org/repos/asf/ambari/blob/9e470887/ambari-server/src/test/java/org/apache/ambari/server/update/HostUpdateHelperTest.java
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/java/org/apache/ambari/server/update/HostUpdateHelperTest.java
b/ambari-server/src/test/java/org/apache/ambari/server/update/HostUpdateHelperTest.java
index 4f08a9a..387205d 100644
--- a/ambari-server/src/test/java/org/apache/ambari/server/update/HostUpdateHelperTest.java
+++ b/ambari-server/src/test/java/org/apache/ambari/server/update/HostUpdateHelperTest.java
@@ -513,8 +513,8 @@ public class HostUpdateHelperTest {
     final Configuration mockConfiguration = easyMockSupport.createNiceMock(Configuration.class);
     JsonObject cluster = new JsonObject();
     JsonObject hostPairs = new JsonObject();
-    hostPairs.add("Host1", new JsonPrimitive("hos11"));
-    hostPairs.add("Host2", new JsonPrimitive("hos22"));
+    hostPairs.add("Host1", new JsonPrimitive("Host11"));
+    hostPairs.add("Host2", new JsonPrimitive("Host22"));
     cluster.add("cl1", hostPairs);
 
     expect(mockConfiguration.getHostChangesJson(null)).andReturn(cluster).once();
@@ -528,7 +528,8 @@ public class HostUpdateHelperTest {
     Map<String, Map<String,String>> hostChangesFileMap = hostUpdateHelper.getHostChangesFileMap();
     Assert.assertTrue(hostChangesFileMap.get("cl1").containsKey("host1"));
     Assert.assertTrue(hostChangesFileMap.get("cl1").containsKey("host2"));
-
+    Assert.assertTrue(hostChangesFileMap.get("cl1").get("host1").equals("host11"));
+    Assert.assertTrue(hostChangesFileMap.get("cl1").get("host2").equals("host22"));
   }
 
 


Mime
View raw message