Repository: incubator-ranger
Updated Branches:
  refs/heads/master 988b2d7aa -> 629e20078


RANGER-1284:Comment lines have not been filtered out when the 
populate_global_dict function parsed install.properties in 
security-admin/scripts/db_setup.py.

Signed-off-by: Don Bosco Durai <bo...@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/629e2007
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ranger/tree/629e2007
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ranger/diff/629e2007

Branch: refs/heads/master
Commit: 629e2007828db2e594379536802ba8503b179e88
Parents: 988b2d7
Author: zhangqiang2 <zhangqia...@zte.com.cn>
Authored: Wed Dec 28 10:48:06 2016 +0800
Committer: Don Bosco Durai <bo...@apache.org>
Committed: Mon Jan 2 09:34:35 2017 -0800

----------------------------------------------------------------------
 security-admin/scripts/db_setup.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/629e2007/security-admin/scripts/db_setup.py
----------------------------------------------------------------------
diff --git a/security-admin/scripts/db_setup.py 
b/security-admin/scripts/db_setup.py
index 7cd1ef0..430aa47 100644
--- a/security-admin/scripts/db_setup.py
+++ b/security-admin/scripts/db_setup.py
@@ -75,9 +75,13 @@ def populate_global_dict():
                read_config_file = 
open(os.path.join(RANGER_ADMIN_HOME,'bin','install_config.properties'))
                library_path = os.path.join(RANGER_ADMIN_HOME,"cred","lib","*")
        for each_line in read_config_file.read().split('\n') :
-               if len(each_line) == 0 : continue
+               each_line = each_line.strip();
+               if len(each_line) == 0:
+                       continue
+               elif each_line[0] == "#":
+                       continue
                if re.search('=', each_line):
-                       key , value = each_line.strip().split("=",1)
+                       key , value = each_line.split("=",1)
                        key = key.strip()
                        if 'PASSWORD' in key:
                                jceks_file_path = 
os.path.join(RANGER_ADMIN_HOME, 'jceks','ranger_db.jceks')

Reply via email to