Repository: ranger
Updated Branches:
  refs/heads/master 5824fdc81 -> 21f8b63f5


RANGER-1901:Similar to RANGER-1846, the JAVA_VERSION_REQUIRED configuration 
item is invalid in kms installer, we should enable it to control the necessary 
java version.

Signed-off-by: zhangqiang2 <[email protected]>


Project: http://git-wip-us.apache.org/repos/asf/ranger/repo
Commit: http://git-wip-us.apache.org/repos/asf/ranger/commit/21f8b63f
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/21f8b63f
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/21f8b63f

Branch: refs/heads/master
Commit: 21f8b63f5d0c6e422bc19adb515ba8a542955ab5
Parents: 5824fdc
Author: peng.jianhua <[email protected]>
Authored: Wed Nov 22 10:51:35 2017 +0800
Committer: zhangqiang2 <[email protected]>
Committed: Thu Nov 23 20:13:55 2017 -0500

----------------------------------------------------------------------
 kms/scripts/setup.sh            | 9 +++++++--
 security-admin/scripts/setup.sh | 2 ++
 2 files changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/21f8b63f/kms/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/kms/scripts/setup.sh b/kms/scripts/setup.sh
index 30999c2..2da1e96 100755
--- a/kms/scripts/setup.sh
+++ b/kms/scripts/setup.sh
@@ -302,8 +302,13 @@ check_java_version() {
        version=$("$JAVA_BIN" -version 2>&1 | awk -F '"' '/version/ {print $2}')
        major=`echo ${version} | cut -d. -f1`
        minor=`echo ${version} | cut -d. -f2`
-       if [[ "${major}" == 1 && "${minor}" < 7 ]] ; then
-               log "[E] Java 1.7 is required, current java version is $version"
+       current_java_version="$major.$minor"
+       num_current_java_version=`echo $current_java_version|awk ' { 
printf("%3.2f\n", $0); } '`
+       JAVA_VERSION_REQUIRED=`echo $JAVA_VERSION_REQUIRED | awk '{gsub(/ 
/,"")}1'`
+       JAVA_VERSION_REQUIRED=`echo $JAVA_VERSION_REQUIRED | awk 
'{gsub(/'"'"'/,"")}1'`
+       num_required_java_version=`echo $JAVA_VERSION_REQUIRED|awk ' { 
printf("%3.2f\n", $0); } '`
+       if [ `echo "$num_current_java_version < $num_required_java_version" | 
bc` -eq 1 ];then
+               log "[E] The java version must be greater than or equal to 
$JAVA_VERSION_REQUIRED, the current java version is $version"
                exit 1;
        fi
 }

http://git-wip-us.apache.org/repos/asf/ranger/blob/21f8b63f/security-admin/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh
index 19008fb..4d09bc2 100755
--- a/security-admin/scripts/setup.sh
+++ b/security-admin/scripts/setup.sh
@@ -305,6 +305,8 @@ check_java_version() {
        minor=`echo ${version} | cut -d. -f2`
        current_java_version="$major.$minor"
        num_current_java_version=`echo $current_java_version|awk ' { 
printf("%3.2f\n", $0); } '`
+       JAVA_VERSION_REQUIRED=`echo $JAVA_VERSION_REQUIRED | awk '{gsub(/ 
/,"")}1'`
+       JAVA_VERSION_REQUIRED=`echo $JAVA_VERSION_REQUIRED | awk 
'{gsub(/'"'"'/,"")}1'`
        num_required_java_version=`echo $JAVA_VERSION_REQUIRED|awk ' { 
printf("%3.2f\n", $0); } '`
        if [ `echo "$num_current_java_version < $num_required_java_version" | 
bc` -eq 1 ];then
                log "[E] The java version must be greater than or equal to 
$JAVA_VERSION_REQUIRED, the current java version is $version"

Reply via email to