This is an automated email from the ASF dual-hosted git repository.

rlevas pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git


The following commit(s) were added to refs/heads/trunk by this push:
     new 5b0e11a  AMBARI-23800. Using the proper concatenation delimiter when 
using the 'append' variable replacement function in a Kerberized cluster
5b0e11a is described below

commit 5b0e11a8cffd3abffb018d7d8c31bd38da2d496f
Author: Sandor Molnar <smol...@apache.org>
AuthorDate: Thu May 10 14:30:32 2018 +0200

    AMBARI-23800. Using the proper concatenation delimiter when using the 
'append' variable replacement function in a Kerberized cluster
---
 .../java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java    | 4 +++-
 .../src/main/resources/stacks/HDP/2.5/services/HIVE/kerberos.json   | 2 +-
 .../org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java     | 6 ++++--
 3 files changed, 8 insertions(+), 4 deletions(-)

diff --git 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
index efd0f27..b7a55ae 100644
--- 
a/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
+++ 
b/ambari-server/src/main/java/org/apache/ambari/server/upgrade/UpgradeCatalog270.java
@@ -1075,7 +1075,9 @@ public class UpgradeCatalog270 extends 
AbstractUpgradeCatalog {
           final String currentHadoopProxyuserHttpHosts = 
coreSiteConfiguration.getProperty(PROPERTY_HADOOP_PROXYUSER_HTTP_HOSTS);
           if (StringUtils.isNotBlank(currentHadoopProxyuserHttpHosts)) {
             LOG.info("Updating hadoop.proxyuser.HTTP.hosts...");
-            
coreSiteConfiguration.putProperty(PROPERTY_HADOOP_PROXYUSER_HTTP_HOSTS, 
currentHadoopProxyuserHttpHosts.replace("webhcat_server_host|", 
"webhcat_server_hosts|"));
+            String newValue = 
currentHadoopProxyuserHttpHosts.replace("webhcat_server_host|", 
"webhcat_server_hosts|"); // replacing webhcat_server_host to 
webhcat_server_hosts
+            newValue = newValue.replace("\\\\,", "\\,"); // Replacing the 
concatDelimiter in 'append' variable replacement function
+            
coreSiteConfiguration.putProperty(PROPERTY_HADOOP_PROXYUSER_HTTP_HOSTS, 
newValue);
             updated = true;
           }
         }
diff --git 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/kerberos.json 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/kerberos.json
index 3d6fa39..33ac06c 100644
--- 
a/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/kerberos.json
+++ 
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/HIVE/kerberos.json
@@ -144,7 +144,7 @@
           "configurations": [
             {
               "core-site": {
-                "hadoop.proxyuser.HTTP.hosts": 
"${clusterHostInfo/webhcat_server_hosts|append(core-site/hadoop.proxyuser.HTTP.hosts,
 \\\\,, true)}"
+                "hadoop.proxyuser.HTTP.hosts": 
"${clusterHostInfo/webhcat_server_hosts|append(core-site/hadoop.proxyuser.HTTP.hosts,
 \\,, true)}"
               }
             },
             {
diff --git 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
index 7a1b686..2268694 100644
--- 
a/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
+++ 
b/ambari-server/src/test/java/org/apache/ambari/server/upgrade/UpgradeCatalog270Test.java
@@ -1232,9 +1232,11 @@ public class UpgradeCatalog270Test {
 
   @Test
   public void testupdateKerberosDescriptorArtifact() throws Exception {
-    //there is HIVE -> WEBHCAT_SERVER -> configurations -> core-site -> 
hadoop.proxyuser.HTTP.hosts
     String kerberosDescriptorJson = 
IOUtils.toString(getClass().getClassLoader().getResourceAsStream("org/apache/ambari/server/upgrade/kerberos_descriptor.json"),
 "UTF-8");
 
+    //there is HIVE -> WEBHCAT_SERVER -> configurations -> core-site -> 
hadoop.proxyuser.HTTP.hosts
+    
assertTrue(kerberosDescriptorJson.contains("${clusterHostInfo/webhcat_server_host|append(core-site/hadoop.proxyuser.HTTP.hosts,
 \\\\\\\\,, true)}"));
+
     ArtifactEntity artifactEntity = new ArtifactEntity();
     artifactEntity.setArtifactName("kerberos_descriptor");
     artifactEntity.setArtifactData(GSON.<Map<String, 
Object>>fromJson(kerberosDescriptorJson, Map.class));
@@ -1253,7 +1255,7 @@ public class UpgradeCatalog270Test {
     int newCount = substringCount(newKerberosDescriptorJson, 
AMBARI_INFRA_NEW_NAME);
     assertThat(newCount, is(oldCount));
 
-    assertTrue(newKerberosDescriptorJson.contains("webhcat_server_hosts|"));
+    
assertTrue(newKerberosDescriptorJson.contains("${clusterHostInfo/webhcat_server_hosts|append(core-site/hadoop.proxyuser.HTTP.hosts,
 \\\\,, true)}"));
 
     verify(upgradeCatalog270);
   }

-- 
To stop receiving notification emails like this one, please contact
rle...@apache.org.

Reply via email to