Repository: ambari Updated Branches: refs/heads/branch-2.4 57a921ba8 -> a92f9787b
Revert "AMBARI-17286 Service config links should use public host name (zhewang)" This reverts commit 6c8c9bef9947c5e5647baca8e3e3cfbb0bae19c1. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/a92f9787 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/a92f9787 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/a92f9787 Branch: refs/heads/branch-2.4 Commit: a92f9787ba6e0fac811428a3f58c90d576f1c06d Parents: 57a921b Author: oleewere <[email protected]> Authored: Mon Jun 20 14:56:59 2016 +0200 Committer: oleewere <[email protected]> Committed: Mon Jun 20 14:56:59 2016 +0200 ---------------------------------------------------------------------- .../stacks/HDP/2.2/services/stack_advisor.py | 3 - .../stacks/HDP/2.3/services/stack_advisor.py | 3 - .../stacks/2.2/common/test_stack_advisor.py | 138 +------------------ .../stacks/2.3/common/test_stack_advisor.py | 3 - ambari-server/src/test/python/unitTests.py | 4 +- 5 files changed, 5 insertions(+), 146 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/a92f9787/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py index 85f679b..22d29e5 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.2/services/stack_advisor.py @@ -774,9 +774,6 @@ class HDP22StackAdvisor(HDP21StackAdvisor): latest_tez_jar_version = None server_host = socket.getfqdn() - for host in hosts["items"]: - if server_host == host["Hosts"]["host_name"]: - server_host = host["Hosts"]["public_host_name"] server_port = '8080' server_protocol = 'http' views_dir = '/var/lib/ambari-server/resources/views/' http://git-wip-us.apache.org/repos/asf/ambari/blob/a92f9787/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py index 6a3df08..c32306d 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.3/services/stack_advisor.py @@ -98,9 +98,6 @@ class HDP23StackAdvisor(HDP22StackAdvisor): latest_tez_jar_version = None server_host = socket.getfqdn() - for host in hosts["items"]: - if server_host == host["Hosts"]["host_name"]: - server_host = host["Hosts"]["public_host_name"] server_port = '8080' server_protocol = 'http' views_dir = '/var/lib/ambari-server/resources/views/' http://git-wip-us.apache.org/repos/asf/ambari/blob/a92f9787/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py index a7e4072..b6f3954 100644 --- a/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.2/common/test_stack_advisor.py @@ -112,60 +112,14 @@ class TestHDP22StackAdvisor(TestCase): services = { "ambari-server-properties": {} } - hosts = { - "items" : [ - { - "href" : "/api/v1/hosts/c6401.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6401.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6401.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - }, - { - "href" : "/api/v1/hosts/c6402.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6402.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6402.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - }, - { - "href" : "/api/v1/hosts/c6403.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6403.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6403.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - } - ] - } server_host = socket.getfqdn() - for host in hosts["items"]: - if server_host == host["Hosts"]["host_name"]: - server_host = host["Hosts"]["public_host_name"] tez_ui_url = "http://" + server_host + ":8080/#/main/views/TEZ/0.7.0.2.3.0.0-2155/TEZ_CLUSTER_INSTANCE" services['ambari-server-properties'] = {'api.ssl': 'false'} expected['tez-site']['properties']['tez.tez-ui.history-url.base'] = tez_ui_url - self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, hosts) + self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, None) self.assertEquals(configurations, expected) def test_recommendTezConfigurations_amMemoryMoreThan3072(self): @@ -205,51 +159,8 @@ class TestHDP22StackAdvisor(TestCase): services = { "ambari-server-properties": {} } - hosts = { - "items" : [ - { - "href" : "/api/v1/hosts/c6401.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6401.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6401.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - }, - { - "href" : "/api/v1/hosts/c6402.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6402.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6402.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - }, - { - "href" : "/api/v1/hosts/c6403.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6403.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6403.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - } - ] - } - self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, hosts) + self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, None) self.assertEquals(configurations, expected) def test_recommendTezConfigurations_mapMemoryLessThan768(self): @@ -289,51 +200,8 @@ class TestHDP22StackAdvisor(TestCase): services = { "ambari-server-properties": {} } - hosts = { - "items" : [ - { - "href" : "/api/v1/hosts/c6401.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6401.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6401.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - }, - { - "href" : "/api/v1/hosts/c6402.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6402.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6402.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - }, - { - "href" : "/api/v1/hosts/c6403.ambari.apache.org", - "Hosts" : { - "cpu_count" : 1, - "host_name" : "c6403.ambari.apache.org", - "os_arch" : "x86_64", - "os_type" : "centos6", - "ph_cpu_count" : 1, - "public_host_name" : "c6403.ambari.apache.org", - "rack_info" : "/default-rack", - "total_mem" : 1922680 - } - } - ] - } - self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, hosts) + self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, None) self.assertEquals(configurations, expected) http://git-wip-us.apache.org/repos/asf/ambari/blob/a92f9787/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py index 9d830da..1bd385f 100644 --- a/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.3/common/test_stack_advisor.py @@ -1951,9 +1951,6 @@ class TestHDP23StackAdvisor(TestCase): self.assertEquals(configurations, expected) server_host = socket.getfqdn() - for host in hosts["items"]: - if server_host == host["Hosts"]["host_name"]: - server_host = host["Hosts"]["public_host_name"] tez_ui_url = "http://" + server_host + ":8080/#/main/views/TEZ/0.7.0.2.3.0.0-2155/TEZ_CLUSTER_INSTANCE" # Test JDK1.7 http://git-wip-us.apache.org/repos/asf/ambari/blob/a92f9787/ambari-server/src/test/python/unitTests.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/unitTests.py b/ambari-server/src/test/python/unitTests.py index 44ae997..b010804 100644 --- a/ambari-server/src/test/python/unitTests.py +++ b/ambari-server/src/test/python/unitTests.py @@ -35,8 +35,8 @@ from ambari_commons.os_family_impl import OsFamilyFuncImpl, OsFamilyImpl STACK_EXCLUDE = ["utils", "1.3.2"] SERVICE_EXCLUDE = ["configs"] -TEST_MASK = 'test_stack_advisor.py' -CUSTOM_TEST_MASK = '[Tt]est*.py' +TEST_MASK = '[Tt]est*.py' +CUSTOM_TEST_MASK = '_[Tt]est*.py' oldtmpdirpath = tempfile.gettempdir() newtmpdirpath = os.path.join(oldtmpdirpath, "ambari-test")
