Repository: ambari Updated Branches: refs/heads/branch-2.1 565e08318 -> 4192bb12e refs/heads/trunk c58162fe3 -> aef3af9b3
AMBARI-13377. External URL (policymgr_external_ur) value in Ranger service should be recommended by stack advisor. Additional fix (dlysnichenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/aef3af9b Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/aef3af9b Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/aef3af9b Branch: refs/heads/trunk Commit: aef3af9b3dc4011e65bcf43586a8e7677677e111 Parents: c58162f Author: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Authored: Mon Oct 12 15:22:29 2015 +0300 Committer: Lisnichenko Dmitro <dlysniche...@hortonworks.com> Committed: Mon Oct 12 15:22:29 2015 +0300 ---------------------------------------------------------------------- .../stacks/HDP/2.0.6/services/stack_advisor.py | 8 +++-- .../stacks/2.0.6/common/test_stack_advisor.py | 34 +++++++++++++++++--- 2 files changed, 35 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/aef3af9b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py index b4c662a..9bb21ea 100644 --- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py +++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/stack_advisor.py @@ -271,8 +271,12 @@ class HDP206StackAdvisor(DefaultStackAdvisor): ranger_admin_host = 'localhost' port = '6080' - if 'ranger-site' in services['configurations'] and 'http.enabled' in services['configurations']['ranger-site']['properties'] \ - and services['configurations']['ranger-site']['properties']['http.enabled'].lower() == 'false': + # Check if http is disabled. For HDP-2.3 this can be checked in ranger-admin-site/ranger.service.http.enabled + # For HDP-2.2 this can be checked in ranger-site/http.enabled + if ('ranger-site' in services['configurations'] and 'http.enabled' in services['configurations']['ranger-site']['properties'] \ + and services['configurations']['ranger-site']['properties']['http.enabled'].lower() == 'false') or \ + ('ranger-admin-site' in services['configurations'] and 'ranger.service.http.enabled' in services['configurations']['ranger-admin-site']['properties'] \ + and services['configurations']['ranger-admin-site']['properties']['ranger.service.http.enabled'].lower() == 'false'): # HTTPS protocol is used protocol = 'https' # In HDP-2.3 port stored in ranger-admin-site ranger.service.https.port http://git-wip-us.apache.org/repos/asf/ambari/blob/aef3af9b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py ---------------------------------------------------------------------- diff --git a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py index 7fdbf73..8ba37c0 100644 --- a/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py +++ b/ambari-server/src/test/python/stacks/2.0.6/common/test_stack_advisor.py @@ -705,11 +705,7 @@ class TestHDP206StackAdvisor(TestCase): "ranger-admin-site": { "properties": { "ranger.service.http.port": "7777", - } - }, - "ranger-site": { - "properties": { - "http.enabled": "true", + "ranger.service.http.enabled": "true", } } } @@ -726,6 +722,34 @@ class TestHDP206StackAdvisor(TestCase): self.stackAdvisor.recommendRangerConfigurations(recommendedConfigurations, clusterData, services, None) self.assertEquals(recommendedConfigurations, expected) + # Recommend for DB_FLAVOR POSTGRES and https enabled, HDP-2.3 + configurations = { + "admin-properties": { + "properties": { + "DB_FLAVOR": "POSTGRES", + } + }, + "ranger-admin-site": { + "properties": { + "ranger.service.https.port": "7777", + "ranger.service.http.enabled": "false", + } + } + } + services['configurations'] = configurations + + expected = { + "admin-properties": { + "properties": { + "SQL_CONNECTOR_JAR": "/usr/share/java/postgresql.jar", + "policymgr_external_url": "https://host1:7777", + } + }, + } + recommendedConfigurations = {} + self.stackAdvisor.recommendRangerConfigurations(recommendedConfigurations, clusterData, services, None) + self.assertEquals(recommendedConfigurations, expected) + # Recommend for DB_FLAVOR ORACLE and https enabled, HDP-2.2 configurations = { "admin-properties": {