You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2016/01/15 22:21:45 UTC
ambari git commit: AMBARI-14696. It failed to change the host name
from lower to upper case for the cluster.(vbrodetskyi)
Repository: ambari
Updated Branches:
refs/heads/branch-2.2 cc8d1ebe2 -> 4f575d15a
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/4f575d15
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/4f575d15
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/4f575d15
Branch: refs/heads/branch-2.2
Commit: 4f575d15a8dbfcfa7fddf48cf9739ad8a1a37b94
Parents: cc8d1eb
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Fri Jan 15 20:39:01 2016 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Fri Jan 15 20:39:01 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/4f575d15/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/4f575d15/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"));
}