Repository: ambari
Updated Branches:
  refs/heads/branch-1.5.0 3c038fdce -> c5419fa84


AMBARI-5190. Add host fails after upgrade from 1.4.4 to 1.5.0 as datanode 
install fails.(vbrodetskyi)


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

Branch: refs/heads/branch-1.5.0
Commit: c5419fa84c5736ad131f926474b24260bb0311f6
Parents: 3c038fd
Author: Vitaly Brodetskyi <[email protected]>
Authored: Tue Mar 25 13:43:42 2014 +0200
Committer: Vitaly Brodetskyi <[email protected]>
Committed: Tue Mar 25 13:43:42 2014 +0200

----------------------------------------------------------------------
 ambari-server/src/main/python/ambari-server.py    | 8 ++++++++
 ambari-server/src/test/python/TestAmbariServer.py | 8 ++++++++
 2 files changed, 16 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/c5419fa8/ambari-server/src/main/python/ambari-server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari-server.py 
b/ambari-server/src/main/python/ambari-server.py
index 97f405e..969bbc9 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -373,6 +373,7 @@ ORACLE_DB_ID_TYPES = ["Service Name", "SID"]
 JDK_NAMES = ["jdk-7u45-linux-x64.tar.gz" , "jdk-6u31-linux-x64.bin"]
 JDK_URL_PROPERTIES = ["jdk1.7.url", "jdk1.6.url"]
 JCE_URL_PROPERTIES = ["jce_policy1.7.url", "jce_policy1.6.url"]
+DEFAULT_JDK16_LOCATION = "/usr/jdk64/jdk1.6.0_31"
 JDK_INDEX = 0
 JDK_VERSION_REs = ["(jdk.*)/jre" , "Creating (jdk.*)/jre"]
 CUSTOM_JDK_NUMBER = "3"
@@ -566,6 +567,13 @@ def update_ambari_properties():
     if not NR_USER_PROPERTY in new_properties.keys():
       new_properties.process_pair(NR_USER_PROPERTY, "root")
 
+    isJDK16Installed = new_properties.get_property(JAVA_HOME_PROPERTY) == 
DEFAULT_JDK16_LOCATION
+    if not JDK_NAME_PROPERTY in new_properties.keys() and isJDK16Installed:
+      new_properties.process_pair(JDK_NAME_PROPERTY,JDK_NAMES[1])
+
+    if not JCE_NAME_PROPERTY in new_properties.keys() and isJDK16Installed:
+      new_properties.process_pair(JCE_NAME_PROPERTY,JCE_POLICY_FILENAMES[1])
+
     new_properties.store(open(conf_file,'w'))
 
   except Exception, e:

http://git-wip-us.apache.org/repos/asf/ambari/blob/c5419fa8/ambari-server/src/test/python/TestAmbariServer.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestAmbariServer.py 
b/ambari-server/src/test/python/TestAmbariServer.py
index 46c3e4c..00424c9 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -3209,6 +3209,8 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
                   "agent.fqdn.service.url=URL\n"]
 
     NEW_PROPERTY = 'some_new_property=some_value\n'
+    JDK_NAME_PROPERTY = 'jdk.name=jdk-6u31-linux-x64.bin\n'
+    JCE_NAME_PROPERTY = 'jce.name=jce_policy-6.zip\n'
     CHANGED_VALUE_PROPERTY = 'server.os_type=should_not_overwrite_value\n'
 
     get_conf_dir_mock.return_value = '/etc/ambari-server/conf'
@@ -3251,6 +3253,12 @@ 
MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
     if not NEW_PROPERTY in ambari_properties_content:
       self.fail()
 
+    if not JDK_NAME_PROPERTY in ambari_properties_content:
+      self.fail()
+
+    if not JCE_NAME_PROPERTY in ambari_properties_content:
+      self.fail()
+
     if CHANGED_VALUE_PROPERTY in ambari_properties_content:
       self.fail()
 

Reply via email to