Updated Branches: refs/heads/trunk 94d849a1e -> 0cd867fc5
AMBARI-2612. Rename agent.fqdn property in ambari.props to server.fqdn. (Dmytro Shkvyra via mahadev) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/0cd867fc Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/0cd867fc Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/0cd867fc Branch: refs/heads/trunk Commit: 0cd867fc5ba8a2381ad836d0a4e0f43a9f33f68b Parents: 94d849a Author: Mahadev Konar <[email protected]> Authored: Wed Jul 10 22:21:34 2013 -0700 Committer: Mahadev Konar <[email protected]> Committed: Wed Jul 10 22:21:34 2013 -0700 ---------------------------------------------------------------------- ambari-server/conf/unix/ambari.properties | 2 +- ambari-server/src/main/python/ambari-server.py | 8 ++++++-- ambari-server/src/test/python/TestAmbaryServer.py | 17 ++++++++++++++--- 3 files changed, 21 insertions(+), 6 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0cd867fc/ambari-server/conf/unix/ambari.properties ---------------------------------------------------------------------- diff --git a/ambari-server/conf/unix/ambari.properties b/ambari-server/conf/unix/ambari.properties index 5db2ec3..01a4b3c 100644 --- a/ambari-server/conf/unix/ambari.properties +++ b/ambari-server/conf/unix/ambari.properties @@ -28,4 +28,4 @@ bootstrap.script=/usr/lib/python2.6/site-packages/ambari_server/bootstrap.py bootstrap.setup_agent.script=/usr/lib/python2.6/site-packages/ambari_server/setupAgent.py api.authenticate=true server.connection.max.idle.millis=900000 -agent.fqdn.service.url=http://169.254.169.254/latest/meta-data/public-hostname +server.fqdn.service.url=http://169.254.169.254/latest/meta-data/public-hostname http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0cd867fc/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 03a1880..29dd4b5 100755 --- a/ambari-server/src/main/python/ambari-server.py +++ b/ambari-server/src/main/python/ambari-server.py @@ -300,7 +300,7 @@ JAVA_HOME_PROPERTY = "java.home" JDK_URL_PROPERTY='jdk.url' JCE_URL_PROPERTY='jce_policy.url' OS_TYPE_PROPERTY = "server.os_type" -GET_FQDN_SERVICE_URL="agent.fqdn.service.url" +GET_FQDN_SERVICE_URL="server.fqdn.service.url" JDK_DOWNLOAD_CMD = "curl --create-dirs -o {0} {1}" JDK_DOWNLOAD_SIZE_CMD = "curl -I {0}" @@ -375,7 +375,11 @@ def update_ambari_properties(): new_properties.load(open(conf_file)) for prop_key, prop_value in old_properties.getPropertyDict().items(): - new_properties.process_pair(prop_key,prop_value) + if ("agent.fqdn.service.url" == prop_key): + #BUG-7179 what is agent.fqdn property in ambari.props? + new_properties.process_pair(GET_FQDN_SERVICE_URL,prop_value) + else: + new_properties.process_pair(prop_key,prop_value) # Adding custom user name property if it is absent # In previous versions without custom user support server was started as http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/0cd867fc/ambari-server/src/test/python/TestAmbaryServer.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/TestAmbaryServer.py b/ambari-server/src/test/python/TestAmbaryServer.py index db8d9a1..1a1a662 100644 --- a/ambari-server/src/test/python/TestAmbaryServer.py +++ b/ambari-server/src/test/python/TestAmbaryServer.py @@ -1276,6 +1276,10 @@ class TestAmbariServer(TestCase): fqdn = ambari_server.get_fqdn() self.assertEqual(fqdn, None) + #Check mbari_server.GET_FQDN_SERVICE_URL property name (AMBARI-2612) + #property name should be server.fqdn.service.url + self.assertEqual(ambari_server.GET_FQDN_SERVICE_URL, "server.fqdn.service.url") + #Read FQDN from service p = MagicMock() p[ambari_server.GET_FQDN_SERVICE_URL] = 'someurl' @@ -2473,7 +2477,8 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV "server.jdbc.user.passwd=/etc/ambari-server/conf/password.dat\n", "java.home=/usr/jdk64/jdk1.6.0_31\n", "server.os_type=redhat6\n", - "ambari-server.user=ambari\n"] + "ambari-server.user=ambari\n", + "agent.fqdn.service.url=URL\n"] NEW_PROPERTY = 'some_new_property=some_value\n' CHANGED_VALUE_PROPERTY = 'server.os_type=should_not_overwrite_value\n' @@ -2507,8 +2512,14 @@ MIIFHjCCAwYCCQDpHKOBI+Lt0zANBgkqhkiG9w0BAQUFADBRMQswCQYDVQQGEwJV ambari_properties_content = f.readlines() for line in properties: - if not line in ambari_properties_content: - self.fail() + if (line == "agent.fqdn.service.url=URL\n"): + if (not ambari_server.GET_FQDN_SERVICE_URL+"=URL\n" in ambari_properties_content) and (line in ambari_properties_content): + self.fail() + else: + if not line in ambari_properties_content: + self.fail() + + if not NEW_PROPERTY in ambari_properties_content: self.fail()
