You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by co...@apache.org on 2017/02/07 09:45:24 UTC

ranger git commit: RANGER-1293:There were logic errors in create_rangerdb_user and grant_xa_db_user function

Repository: ranger
Updated Branches:
  refs/heads/master 90619aa10 -> 70fc18099


RANGER-1293:There were logic errors in create_rangerdb_user and grant_xa_db_user function

Signed-off-by: Colm O hEigeartaigh <co...@apache.org>


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

Branch: refs/heads/master
Commit: 70fc18099bd54c290aa832e3708c72f5307d7d55
Parents: 90619aa
Author: zhangqiang2 <zh...@zte.com.cn>
Authored: Thu Jan 19 15:20:47 2017 +0800
Committer: Colm O hEigeartaigh <co...@apache.org>
Committed: Tue Feb 7 09:45:15 2017 +0000

----------------------------------------------------------------------
 security-admin/scripts/dba_script.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/70fc1809/security-admin/scripts/dba_script.py
----------------------------------------------------------------------
diff --git a/security-admin/scripts/dba_script.py b/security-admin/scripts/dba_script.py
index 2c69157..1f99328 100644
--- a/security-admin/scripts/dba_script.py
+++ b/security-admin/scripts/dba_script.py
@@ -205,7 +205,7 @@ class MysqlConf(BaseDB):
 	def create_rangerdb_user(self, root_user, db_user, db_password, db_root_password,dryMode):
 		if self.check_connection('mysql', root_user, db_root_password):
 			hosts_arr =["%", "localhost"]
-			hosts_arr.append(self.host)
+			if not self.host == "localhost": hosts_arr.append(self.host)
 			for host in hosts_arr:
 				get_cmd = self.get_jisql_cmd(root_user, db_root_password, 'mysql')
 				if self.verify_user(root_user, db_root_password, host, db_user, get_cmd,dryMode):
@@ -306,7 +306,7 @@ class MysqlConf(BaseDB):
 
 	def grant_xa_db_user(self, root_user, db_name, db_user, db_password, db_root_password, is_revoke,dryMode):
 		hosts_arr =["%", "localhost"]
-		hosts_arr.append(self.host)
+		if not self.host == "localhost": hosts_arr.append(self.host)
 		for host in hosts_arr:
 			if dryMode == False:
 				log("[I] ---------- Granting privileges TO user '"+db_user+"'@'"+host+"' on db '"+db_name+"'----------" , "info")