This is an automated email from the ASF dual-hosted git repository. jonathanhurley pushed a commit to branch branch-2.6 in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/branch-2.6 by this push: new 8e0a6d1 AMBARI-22951 Export JAVA_HOME env variable in shell script for Ranger (mugdha) 8e0a6d1 is described below commit 8e0a6d1274951af18616afdf828b3981b443ab35 Author: Mugdha Varadkar <mug...@apache.org> AuthorDate: Tue Feb 6 19:01:49 2018 +0530 AMBARI-22951 Export JAVA_HOME env variable in shell script for Ranger (mugdha) --- .../RANGER/0.4.0/package/scripts/setup_ranger_xml.py | 7 +++++++ .../RANGER_KMS/0.5.0.2.3/package/scripts/kms.py | 7 +++++++ .../src/test/python/stacks/2.5/RANGER/test_ranger_admin.py | 14 ++++++++++++++ .../test/python/stacks/2.5/RANGER_KMS/test_kms_server.py | 14 ++++++++++++++ .../src/test/python/stacks/2.6/RANGER/test_ranger_admin.py | 14 ++++++++++++++ 5 files changed, 56 insertions(+) diff --git a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py index 35a0363..ea9de56 100644 --- a/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py +++ b/ambari-server/src/main/resources/common-services/RANGER/0.4.0/package/scripts/setup_ranger_xml.py @@ -120,6 +120,13 @@ def setup_ranger_admin(upgrade_type=None): create_parents=True ) + File(format('{ranger_conf}/ranger-admin-env.sh'), + content = format("export JAVA_HOME={java_home}"), + owner = params.unix_user, + group = params.unix_group, + mode = 0755 + ) + if params.stack_supports_pid: File(format('{ranger_conf}/ranger-admin-env-piddir.sh'), content = format("export RANGER_PID_DIR_PATH={ranger_pid_dir}\nexport RANGER_USER={unix_user}"), diff --git a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py index bbc438b..e97f9e5 100755 --- a/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py +++ b/ambari-server/src/main/resources/common-services/RANGER_KMS/0.5.0.2.3/package/scripts/kms.py @@ -226,6 +226,13 @@ def kms(upgrade_type=None): create_parents=True ) + File(format('{kms_conf_dir}/ranger-kms-env.sh'), + content = format("export JAVA_HOME={java_home}"), + owner = params.kms_user, + group = params.kms_group, + mode = 0755 + ) + if params.stack_supports_pid: File(format('{kms_conf_dir}/ranger-kms-env-piddir.sh'), content = format("export RANGER_KMS_PID_DIR_PATH={ranger_kms_pid_dir}\nexport KMS_USER={kms_user}"), diff --git a/ambari-server/src/test/python/stacks/2.5/RANGER/test_ranger_admin.py b/ambari-server/src/test/python/stacks/2.5/RANGER/test_ranger_admin.py index 9ba1275..a5b7383 100644 --- a/ambari-server/src/test/python/stacks/2.5/RANGER/test_ranger_admin.py +++ b/ambari-server/src/test/python/stacks/2.5/RANGER/test_ranger_admin.py @@ -265,6 +265,13 @@ class TestRangerAdmin(RMFTestCase): create_parents=True ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env.sh', + content = 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45', + owner = 'ranger', + group = 'ranger', + mode = 0755 + ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env-piddir.sh', content = 'export RANGER_PID_DIR_PATH=/var/run/ranger\nexport RANGER_USER=ranger', owner = 'ranger', @@ -421,6 +428,13 @@ class TestRangerAdmin(RMFTestCase): create_parents=True ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env.sh', + content = 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45', + owner = 'ranger', + group = 'ranger', + mode = 0755 + ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env-piddir.sh', content = 'export RANGER_PID_DIR_PATH=/var/run/ranger\nexport RANGER_USER=ranger', owner = 'ranger', diff --git a/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py b/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py index 34ca102..c971d44 100644 --- a/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py +++ b/ambari-server/src/test/python/stacks/2.5/RANGER_KMS/test_kms_server.py @@ -357,6 +357,13 @@ class TestRangerKMS(RMFTestCase): create_parents=True ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-kms/conf/ranger-kms-env.sh', + content = 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45', + owner = 'kms', + group = 'kms', + mode = 0755 + ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-kms/conf/ranger-kms-env-piddir.sh', content = 'export RANGER_KMS_PID_DIR_PATH=/var/run/ranger_kms\nexport KMS_USER=kms', owner = 'kms', @@ -780,6 +787,13 @@ class TestRangerKMS(RMFTestCase): create_parents=True ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-kms/conf/ranger-kms-env.sh', + content = 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45', + owner = 'kms', + group = 'kms', + mode = 0755 + ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-kms/conf/ranger-kms-env-piddir.sh', content = 'export RANGER_KMS_PID_DIR_PATH=/var/run/ranger_kms\nexport KMS_USER=kms', owner = 'kms', diff --git a/ambari-server/src/test/python/stacks/2.6/RANGER/test_ranger_admin.py b/ambari-server/src/test/python/stacks/2.6/RANGER/test_ranger_admin.py index e8bacbd..e932648 100644 --- a/ambari-server/src/test/python/stacks/2.6/RANGER/test_ranger_admin.py +++ b/ambari-server/src/test/python/stacks/2.6/RANGER/test_ranger_admin.py @@ -308,6 +308,13 @@ class TestRangerAdmin(RMFTestCase): create_parents=True ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env.sh', + content = 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45', + owner = 'ranger', + group = 'ranger', + mode = 0755 + ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env-piddir.sh', content = 'export RANGER_PID_DIR_PATH=/var/run/ranger\nexport RANGER_USER=ranger', owner = 'ranger', @@ -486,6 +493,13 @@ class TestRangerAdmin(RMFTestCase): create_parents=True ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env.sh', + content = 'export JAVA_HOME=/usr/jdk64/jdk1.7.0_45', + owner = 'ranger', + group = 'ranger', + mode = 0755 + ) + self.assertResourceCalled('File', '/usr/hdp/current/ranger-admin/conf/ranger-admin-env-piddir.sh', content = 'export RANGER_PID_DIR_PATH=/var/run/ranger\nexport RANGER_USER=ranger', owner = 'ranger', -- To stop receiving notification emails like this one, please contact jonathanhur...@apache.org.