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 2018/03/29 02:47:35 UTC

ranger git commit: RANGER-2042:Fix error variable and remove invalid import package in upgrade_admin.py file of the security admin.

Repository: ranger
Updated Branches:
  refs/heads/master e80464244 -> b6d45a261


RANGER-2042:Fix error variable and remove invalid import package in upgrade_admin.py file of the security admin.

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/b6d45a26
Tree: http://git-wip-us.apache.org/repos/asf/ranger/tree/b6d45a26
Diff: http://git-wip-us.apache.org/repos/asf/ranger/diff/b6d45a26

Branch: refs/heads/master
Commit: b6d45a261810b3ddbf3bca5bb68110a86dd5060c
Parents: e804642
Author: zhangqiang2 <zh...@zte.com.cn>
Authored: Tue Mar 27 11:40:32 2018 +0800
Committer: zhangqiang2 <zh...@zte.com.cn>
Committed: Thu Mar 29 10:47:10 2018 +0800

----------------------------------------------------------------------
 security-admin/scripts/upgrade_admin.py | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ranger/blob/b6d45a26/security-admin/scripts/upgrade_admin.py
----------------------------------------------------------------------
diff --git a/security-admin/scripts/upgrade_admin.py b/security-admin/scripts/upgrade_admin.py
index 5c79192..28b7e98 100755
--- a/security-admin/scripts/upgrade_admin.py
+++ b/security-admin/scripts/upgrade_admin.py
@@ -13,15 +13,13 @@
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
-import re
 import StringIO
 import xml.etree.ElementTree as ET
 import ConfigParser
-import os,errno,sys,getopt
+import os,sys,getopt
 from os import listdir
 from os.path import isfile, join, dirname, basename
-from urlparse import urlparse
-from time import gmtime, strftime, localtime
+from time import strftime, localtime
 import shutil
 
 debugLevel = 1
@@ -236,7 +234,7 @@ def main():
 			tempLibFile=join(tempLibFolder,mysqlConnectorJarFileName[0])
 			shutil.copy(join(libFolder,mysqlConnectorJarFileName[0]), tempLibFile)
 			installProps['SQL_CONNECTOR_JAR'] = tempLibFile
-	elif (token[3] == 'odbc'):
+	elif (tokens[3] == 'odbc'):
 		installProps['DB_FLAVOR'] = 'ORACLE'
 		installProps['SQL_COMMAND_INVOKER'] = 'sqlplus'
 		installProps['db_host'] = dbTokens[0]
@@ -325,11 +323,9 @@ def writeToFile(keyList, defValMap, props, outFileName):
 
 	for key in keyList:
 		if (key in props):
-			print >> outf, "%s=%s" % (key,props[key]) 
-			val = props[key]
+			print >> outf, "%s=%s" % (key,props[key])
 		else:
-			print >> outf,  "# Default value for [%s] is used\n%s=%s\n#---" % (key, key,defValMap[key]) 
-			val = defValMap[key]
+			print >> outf,  "# Default value for [%s] is used\n%s=%s\n#---" % (key, key,defValMap[key])
 			
 	outf.flush()
 	outf.close()