ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From v..@apache.org
Subject incubator-ranger git commit: RANGER-588 : Take care of Ranger KMS installation even if java is not in PATH
Date Mon, 31 Aug 2015 15:01:29 GMT
Repository: incubator-ranger
Updated Branches:
  refs/heads/ranger-0.5 5ed0e6ef7 -> 67e845a3b


RANGER-588 : Take care of Ranger KMS installation even if java is not in PATH

Signed-off-by: Velmurugan Periasamy <vel@apache.org>


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

Branch: refs/heads/ranger-0.5
Commit: 67e845a3bf4c704c647457f7a0404a3e3a7551a2
Parents: 5ed0e6e
Author: Gautam Borad <gborad@gmail.com>
Authored: Fri Aug 7 12:19:11 2015 +0530
Committer: Velmurugan Periasamy <vel@apache.org>
Committed: Mon Aug 31 11:01:10 2015 -0400

----------------------------------------------------------------------
 kms/scripts/db_setup.py   | 23 +----------------------
 kms/scripts/dba_script.py | 26 ++------------------------
 2 files changed, 3 insertions(+), 46 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/67e845a3/kms/scripts/db_setup.py
----------------------------------------------------------------------
diff --git a/kms/scripts/db_setup.py b/kms/scripts/db_setup.py
old mode 100644
new mode 100755
index 61940cc..5e2f950
--- a/kms/scripts/db_setup.py
+++ b/kms/scripts/db_setup.py
@@ -72,31 +72,10 @@ def populate_global_dict():
 			key , value = each_line.strip().split("=",1)
 			key = key.strip()
 			if 'PASSWORD' in key:
-				jceks_file_path = os.path.join(RANGER_KMS_HOME, 'jceks','ranger_db.jceks')
-				statuscode,value = call_keystore(library_path,key,'',jceks_file_path,'get')
-				if statuscode == 1:
-					value = ''
+				value = ''
 			value = value.strip()
 			globalDict[key] = value
 
-def call_keystore(libpath,aliasKey,aliasValue , filepath,getorcreate):
-    finalLibPath = libpath.replace('\\','/').replace('//','/')
-    finalFilePath = 'jceks://file/'+filepath.replace('\\','/').replace('//','/')
-    if getorcreate == 'create':
-        commandtorun = ['java', '-cp', finalLibPath, 'org.apache.ranger.credentialapi.buildks'
,'create', aliasKey, '-value', aliasValue, '-provider',finalFilePath]
-        p = Popen(commandtorun,stdin=PIPE, stdout=PIPE, stderr=PIPE)
-        output, error = p.communicate()
-        statuscode = p.returncode
-        return statuscode
-    elif getorcreate == 'get':
-        commandtorun = ['java', '-cp', finalLibPath, 'org.apache.ranger.credentialapi.buildks'
,'get', aliasKey, '-provider',finalFilePath]
-        p = Popen(commandtorun,stdin=PIPE, stdout=PIPE, stderr=PIPE)
-        output, error = p.communicate()
-        statuscode = p.returncode
-        return statuscode, output
-    else:
-        print 'proper command not received for input need get or create'
-
 class BaseDB(object):
 
 	def check_connection(self, db_name, db_user, db_password):

http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/67e845a3/kms/scripts/dba_script.py
----------------------------------------------------------------------
diff --git a/kms/scripts/dba_script.py b/kms/scripts/dba_script.py
old mode 100644
new mode 100755
index 03e0a19..b2aa80a
--- a/kms/scripts/dba_script.py
+++ b/kms/scripts/dba_script.py
@@ -37,25 +37,6 @@ if os_name == "LINUX":
 elif os_name == "WINDOWS":
     RANGER_KMS_HOME = os.getenv("RANGER_KMS_HOME")
 
-def call_keystore(libpath,aliasKey,aliasValue , filepath,getorcreate):
-    finalLibPath = libpath.replace('\\','/').replace('//','/')
-    finalFilePath = 'jceks://file/'+filepath.replace('\\','/').replace('//','/')
-    if getorcreate == 'create':
-        commandtorun = ['java', '-cp', finalLibPath, 'org.apache.ranger.credentialapi.buildks'
,'create', aliasKey, '-value', aliasValue, '-provider',finalFilePath]
-        p = Popen(commandtorun,stdin=PIPE, stdout=PIPE, stderr=PIPE)
-        output, error = p.communicate()
-        statuscode = p.returncode
-        return statuscode
-    elif getorcreate == 'get':
-        commandtorun = ['java', '-cp', finalLibPath, 'org.apache.ranger.credentialapi.buildks'
,'get', aliasKey, '-provider',finalFilePath]
-        p = Popen(commandtorun,stdin=PIPE, stdout=PIPE, stderr=PIPE)
-        output, error = p.communicate()
-        statuscode = p.returncode
-        return statuscode, output
-    else:
-        print 'proper command not received for input need get or create'
-
-
 def check_output(query):
 	if os_name == "LINUX":
 		p = subprocess.Popen(shlex.split(query), stdout=subprocess.PIPE)
@@ -83,17 +64,14 @@ def populate_global_dict():
 	elif os_name == "WINDOWS":
 		read_config_file = open(os.path.join(RANGER_KMS_HOME,'bin','install_config.properties'))
 	library_path = os.path.join(RANGER_KMS_HOME,"cred","lib","*")
-	read_config_file = open(os.path.join(RANGER_KMS_HOME,'install.properties'))
+        read_config_file = open(os.path.join(RANGER_KMS_HOME,'install.properties'))
 	for each_line in read_config_file.read().split('\n') :
 		if len(each_line) == 0 : continue
 		if re.search('=', each_line):
 			key , value = each_line.strip().split("=",1)
 			key = key.strip()
 			if 'PASSWORD' in key:
-				jceks_file_path = os.path.join(RANGER_KMS_HOME, 'jceks','ranger_db.jceks')
-				statuscode,value = call_keystore(library_path,key,'',jceks_file_path,'get')
-				if statuscode == 1:
-					value = ''
+				value = ''
 			value = value.strip()
 			globalDict[key] = value
 


Mime
View raw message