Repository: ambari Updated Branches: refs/heads/branch-2.1 9cd5429e2 -> fc6b7169b
Revert "AMBARI-11824 - Views: Tez View should automatically work out of the box in Ambari 2.1 (tbeerbower)" This reverts commit f122348f01cbb9b5cefe572cfa7c1b4bd5b22b01. Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fc6b7169 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fc6b7169 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fc6b7169 Branch: refs/heads/branch-2.1 Commit: fc6b7169bec9aca9695e4749b22af6f90aabe20b Parents: 9cd5429 Author: tbeerbower <tbeerbo...@hortonworks.com> Authored: Thu Jun 18 17:24:11 2015 -0400 Committer: tbeerbower <tbeerbo...@hortonworks.com> Committed: Thu Jun 18 17:24:11 2015 -0400 ---------------------------------------------------------------------- .../stacks/HDP/2.3/services/stack_advisor.py | 14 ++++++-------- .../python/stacks/2.3/common/test_stack_advisor.py | 13 +------------ 2 files changed, 7 insertions(+), 20 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/fc6b7169/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 1075a06..d65d711 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 @@ -63,14 +63,12 @@ class HDP23StackAdvisor(HDP22StackAdvisor): if 'views.dir' in serverProperties: views_dir = serverProperties['views.dir'] - views_work_dir = os.path.join(views_dir, 'work') - - if os.path.exists(views_work_dir) and os.path.isdir(views_work_dir): + if os.path.exists(views_dir) and os.path.isdir(views_dir): last_version = '0.0.0' - for file in os.listdir(views_work_dir): - if fnmatch.fnmatch(file, 'TEZ{*}'): - current_version = file.lstrip("TEZ{").rstrip("}") # E.g.: TEZ{0.7.0.2.3.0.0-2154} - if self.versionCompare(current_version.replace("-", "."), last_version.replace("-", ".")) >= 0: + for file in os.listdir(views_dir): + if fnmatch.fnmatch(file, 'tez-view*.jar'): + current_version = file.lstrip("tez-view-")[:-4] # E.g.: tez-view-2.1.0.2043.jar + if self.versionCompare(current_version, last_version) >= 0: latest_tez_jar_version = current_version last_version = current_version pass @@ -79,7 +77,7 @@ class HDP23StackAdvisor(HDP22StackAdvisor): pass if latest_tez_jar_version: - tez_url = 'http://{0}:{1}/#/main/views/TEZ/{2}/TEZ_CLUSTER_INSTANCE'.format(server_host, server_port, latest_tez_jar_version) + tez_url = 'http://{0}:{1}/views/TEZ/{2}/TEZ_CLUSTER_INSTANCE'.format(server_host, server_port, latest_tez_jar_version) putTezProperty("tez.tez-ui.history-url.base", tez_url) pass http://git-wip-us.apache.org/repos/asf/ambari/blob/fc6b7169/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 da85cfc..2f73f18 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 @@ -480,15 +480,7 @@ class TestHDP23StackAdvisor(TestCase): self.stackAdvisor.recommendHIVEConfigurations(configurations, clusterData, services, hosts) self.assertEquals(configurations, expected) - @patch('os.path.exists') - @patch('os.path.isdir') - @patch('os.listdir') - def test_recommendTezConfigurations(self, os_listdir_mock, os_isdir_mock, os_exists_mock): - - os_exists_mock.return_value = True - os_isdir_mock.return_value = True - os_listdir_mock.return_value = ['TEZ{0.7.0.2.3.0.0-2155}'] - + def test_recommendTezConfigurations(self): self.maxDiff = None configurations = { "yarn-site": { @@ -656,7 +648,6 @@ class TestHDP23StackAdvisor(TestCase): # Test JDK1.7 services['ambari-server-properties'] = {'java.home': '/usr/jdk64/jdk1.7.3_23'} - expected['tez-site']['properties']['tez.tez-ui.history-url.base'] = "http://hw11465.home:8080/#/main/views/TEZ/0.7.0.2.3.0.0-2155/TEZ_CLUSTER_INSTANCE" self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, hosts) self.assertEquals(configurations, expected) @@ -664,7 +655,6 @@ class TestHDP23StackAdvisor(TestCase): services['ambari-server-properties'] = {'java.home': '/usr/jdk64/jdk1.8_44'} expected['tez-site']['properties']['tez.am.launch.cmd-opts'] = "-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseG1GC -XX:+ResizeTLAB" expected['tez-site']['properties']['tez.task.launch.cmd-opts'] = "-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseG1GC -XX:+ResizeTLAB" - expected['tez-site']['properties']['tez.tez-ui.history-url.base'] = "http://hw11465.home:8080/#/main/views/TEZ/0.7.0.2.3.0.0-2155/TEZ_CLUSTER_INSTANCE" self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, hosts) self.assertEquals(configurations, expected) @@ -672,7 +662,6 @@ class TestHDP23StackAdvisor(TestCase): services['ambari-server-properties'] = {'java.home': '/usr/jdk64/jdk1.9.2_44'} expected['tez-site']['properties']['tez.am.launch.cmd-opts'] = "-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseG1GC -XX:+ResizeTLAB" expected['tez-site']['properties']['tez.task.launch.cmd-opts'] = "-XX:+PrintGCDetails -verbose:gc -XX:+PrintGCTimeStamps -XX:+UseNUMA -XX:+UseG1GC -XX:+ResizeTLAB" - expected['tez-site']['properties']['tez.tez-ui.history-url.base'] = "http://hw11465.home:8080/#/main/views/TEZ/0.7.0.2.3.0.0-2155/TEZ_CLUSTER_INSTANCE" self.stackAdvisor.recommendTezConfigurations(configurations, clusterData, services, hosts) self.assertEquals(configurations, expected)