Repository: ambari
Updated Branches:
  refs/heads/trunk 343d41ef5 -> 79692547b


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/79692547
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/79692547
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/79692547

Branch: refs/heads/trunk
Commit: 79692547ba3f817ff9766535001edf8f20a685e9
Parents: 343d41e
Author: Vitaly Brodetskyi <[email protected]>
Authored: Tue Mar 25 13:41:04 2014 +0200
Committer: Vitaly Brodetskyi <[email protected]>
Committed: Tue Mar 25 13:41:04 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/79692547/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 6c9fcd3..acdb683 100755
--- a/ambari-server/src/main/python/ambari-server.py
+++ b/ambari-server/src/main/python/ambari-server.py
@@ -374,6 +374,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"
@@ -567,6 +568,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/79692547/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