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 2015/11/10 16:32:25 UTC

ambari git commit: AMBARI-13809. In an upgraded cluster: JDK 1.8 option not available in ambari-server setup.(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 7b5a47a11 -> 3dfdb6c61


AMBARI-13809. In an upgraded cluster: JDK 1.8 option not available in ambari-server setup.(vbrodetskyi)


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

Branch: refs/heads/branch-2.1
Commit: 3dfdb6c616dbc5af562a9439364e029e6c41a75f
Parents: 7b5a47a
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Tue Nov 10 17:31:16 2015 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Tue Nov 10 17:31:16 2015 +0200

----------------------------------------------------------------------
 .../src/main/python/ambari_server/serverConfiguration.py     | 5 ++++-
 ambari-server/src/test/python/TestAmbariServer.py            | 8 +++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3dfdb6c6/ambari-server/src/main/python/ambari_server/serverConfiguration.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/python/ambari_server/serverConfiguration.py b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
index 95d59d8..2ad11af 100644
--- a/ambari-server/src/main/python/ambari_server/serverConfiguration.py
+++ b/ambari-server/src/main/python/ambari_server/serverConfiguration.py
@@ -976,10 +976,13 @@ def update_ambari_properties():
 
     for prop_key, prop_value in old_properties.getPropertyDict().items():
       if "agent.fqdn.service.url" == prop_key:
-        # BUG-7179 what is agent.fqdn property in ambari.props?
+        # what is agent.fqdn property in ambari.props?
         new_properties.process_pair(GET_FQDN_SERVICE_URL, prop_value)
       elif "server.os_type" == prop_key:
         new_properties.process_pair(OS_TYPE_PROPERTY, OS_FAMILY + OS_VERSION)
+      elif JDK_RELEASES == prop_key:
+        # don't replace new jdk releases with old releases, because they can be updated
+        pass
       else:
         new_properties.process_pair(prop_key, prop_value)
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/3dfdb6c6/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 301d91b..d38dc4e 100644
--- a/ambari-server/src/test/python/TestAmbariServer.py
+++ b/ambari-server/src/test/python/TestAmbariServer.py
@@ -4636,9 +4636,11 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
                   "java.home=/usr/jdk64/jdk1.6.0_31\n",
                   "server.jdbc.database_name=ambari\n",
                   "ambari-server.user=ambari\n",
-                  "agent.fqdn.service.url=URL\n"]
+                  "agent.fqdn.service.url=URL\n",
+                  "java.releases=jdk1.7,jdk1.6\n"]
 
     NEW_PROPERTY = 'some_new_property=some_value\n'
+    JAVA_RELEASES_NEW_PROPERTY = 'java.releases=jdk1.8,jdk1.7\n'
     CHANGED_VALUE_PROPERTY = 'server.jdbc.database_name=should_not_overwrite_value\n'
 
     get_conf_dir_mock.return_value = '/etc/ambari-server/conf'
@@ -4651,6 +4653,7 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
     with open(serverConfiguration.AMBARI_PROPERTIES_FILE, "w") as f:
       f.write(NEW_PROPERTY)
       f.write(CHANGED_VALUE_PROPERTY)
+      f.write(JAVA_RELEASES_NEW_PROPERTY)
       f.close()
 
     with open(configDefaults.AMBARI_PROPERTIES_BACKUP_FILE, 'w') as f:
@@ -4676,6 +4679,9 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV
         if (not GET_FQDN_SERVICE_URL + "=URL\n" in ambari_properties_content) and (
           line in ambari_properties_content):
           self.fail()
+      elif line == "java.releases=jdk1.7,jdk1.6\n":
+        if not "java.releases=jdk1.8,jdk1.7\n" in ambari_properties_content:
+          self.fail()
       else:
         if not line in ambari_properties_content:
           self.fail()