You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by zh...@apache.org on 2017/04/25 00:49:08 UTC

ranger git commit: RANGER-1525:Some users hope that the execute programs and install configuration file of the Ranger Admin can be deployed separately when they integrate Ranger into the big data platform or business systems to uniform install Ranger.

Repository: ranger
Updated Branches:
  refs/heads/master 27bd3fe5c -> fd5972967


RANGER-1525:Some users hope that the execute programs and install configuration file of the Ranger Admin can be deployed separately when they integrate Ranger into the big data platform or business systems to uniform install Ranger.

Signed-off-by: zhangqiang2 <zh...@zte.com.cn>


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

Branch: refs/heads/master
Commit: fd597296756c0680e136439271c05d1ff38d86c9
Parents: 27bd3fe
Author: peng.jianhua <pe...@zte.com.cn>
Authored: Mon Apr 24 08:33:28 2017 +0800
Committer: zhangqiang2 <zh...@zte.com.cn>
Committed: Mon Apr 24 20:47:59 2017 -0400

----------------------------------------------------------------------
 security-admin/scripts/db_setup.py   | 11 +++++++++--
 security-admin/scripts/dba_script.py | 11 +++++++++--
 security-admin/scripts/setup.sh      |  2 +-
 3 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/fd597296/security-admin/scripts/db_setup.py
----------------------------------------------------------------------
diff --git a/security-admin/scripts/db_setup.py b/security-admin/scripts/db_setup.py
index 6e79151..b2b29ee 100644
--- a/security-admin/scripts/db_setup.py
+++ b/security-admin/scripts/db_setup.py
@@ -50,6 +50,13 @@ if socket.getfqdn().find('.')>=0:
 else:
 	client_host=socket.gethostbyaddr(socket.gethostname())[0]
 
+RANGER_ADMIN_CONF = os.getenv("RANGER_ADMIN_CONF")
+if RANGER_ADMIN_CONF is None:
+	if is_unix:
+		RANGER_ADMIN_CONF = RANGER_ADMIN_HOME
+	elif os_name == "WINDOWS":
+		RANGER_ADMIN_CONF = os.path.join(RANGER_ADMIN_HOME,'bin')
+
 def check_output(query):
 	if is_unix:
 		p = subprocess.Popen(shlex.split(query), stdout=subprocess.PIPE)
@@ -73,9 +80,9 @@ def log(msg,type):
 def populate_global_dict():
 	global globalDict
 	if is_unix:
-		read_config_file = open(os.path.join(RANGER_ADMIN_HOME,'install.properties'))
+		read_config_file = open(os.path.join(RANGER_ADMIN_CONF,'install.properties'))
 	elif os_name == "WINDOWS":
-		read_config_file = open(os.path.join(RANGER_ADMIN_HOME,'bin','install_config.properties'))
+		read_config_file = open(os.path.join(RANGER_ADMIN_CONF,'install_config.properties'))
 		library_path = os.path.join(RANGER_ADMIN_HOME,"cred","lib","*")
 	for each_line in read_config_file.read().split('\n') :
 		each_line = each_line.strip();

http://git-wip-us.apache.org/repos/asf/ranger/blob/fd597296/security-admin/scripts/dba_script.py
----------------------------------------------------------------------
diff --git a/security-admin/scripts/dba_script.py b/security-admin/scripts/dba_script.py
index 83d6fe7..a4f6c97 100644
--- a/security-admin/scripts/dba_script.py
+++ b/security-admin/scripts/dba_script.py
@@ -42,6 +42,13 @@ if is_unix:
 elif os_name == "WINDOWS":
 	RANGER_ADMIN_HOME = os.getenv("RANGER_ADMIN_HOME")
 
+RANGER_ADMIN_CONF = os.getenv("RANGER_ADMIN_CONF")
+if RANGER_ADMIN_CONF is None:
+	if is_unix:
+		RANGER_ADMIN_CONF = RANGER_ADMIN_HOME
+	elif os_name == "WINDOWS":
+		RANGER_ADMIN_CONF = os.path.join(RANGER_ADMIN_HOME,'bin')
+
 def check_output(query):
 	if is_unix:
 		p = subprocess.Popen(shlex.split(query), stdout=subprocess.PIPE)
@@ -65,9 +72,9 @@ def log(msg,type):
 def populate_global_dict():
 	global globalDict
 	if is_unix:
-		read_config_file = open(os.path.join(RANGER_ADMIN_HOME,'install.properties'))
+		read_config_file = open(os.path.join(RANGER_ADMIN_CONF,'install.properties'))
 	elif os_name == "WINDOWS":
-		read_config_file = open(os.path.join(RANGER_ADMIN_HOME,'bin','install_config.properties'))
+		read_config_file = open(os.path.join(RANGER_ADMIN_CONF,'install_config.properties'))
 		library_path = os.path.join(RANGER_ADMIN_HOME,"cred","lib","*")
 	for cireach_line in read_config_file.read().split('\n') :
 		each_line = cireach_line.strip()

http://git-wip-us.apache.org/repos/asf/ranger/blob/fd597296/security-admin/scripts/setup.sh
----------------------------------------------------------------------
diff --git a/security-admin/scripts/setup.sh b/security-admin/scripts/setup.sh
index e77b2a9..3b259a0 100755
--- a/security-admin/scripts/setup.sh
+++ b/security-admin/scripts/setup.sh
@@ -42,7 +42,7 @@ get_prop(){
         fi
 }
 
-PROPFILE=$PWD/install.properties
+PROPFILE=${RANGER_ADMIN_CONF:-$PWD}/install.properties
 if [ ! -f "${PROPFILE}" ]; then
     echo "$PROPFILE file not found....!!"
     exit 1;