You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ranger.apache.org by sn...@apache.org on 2014/10/09 18:06:09 UTC

git commit: ARGUS-108: fixed database type case sensitivity and handling of invalid audit database type

Repository: incubator-argus
Updated Branches:
  refs/heads/master 091efb7d9 -> 5dfd15e3c


ARGUS-108: fixed database type case sensitivity and handling of invalid audit database type


Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/5dfd15e3
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/5dfd15e3
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/5dfd15e3

Branch: refs/heads/master
Commit: 5dfd15e3ccf5c7d4507e8a073a339dd299b0077b
Parents: 091efb7
Author: sneethiraj <sn...@apache.org>
Authored: Thu Oct 9 09:25:37 2014 -0400
Committer: sneethiraj <sn...@apache.org>
Committed: Thu Oct 9 09:25:37 2014 -0400

----------------------------------------------------------------------
 agents-common/scripts/enable-agent.sh | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/5dfd15e3/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index b6884de..09e8b12 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -280,7 +280,7 @@ then
 	# We need to do the AUDIT JDBC url 
 	#
 
-	db_flavor=`grep '^XAAUDIT.DB.FLAVOUR' ${INSTALL_ARGS} | awk -F= '{ print $2 }'`
+	db_flavor=`grep '^XAAUDIT.DB.FLAVOUR' ${INSTALL_ARGS} | awk -F= '{ print $2 }' |  tr '[:lower:]' '[:upper:]'`
     audit_db_hostname=`grep '^XAAUDIT.DB.HOSTNAME'  ${INSTALL_ARGS}  | awk -F= '{ print $2 }'`
     audit_db_name=`grep '^XAAUDIT.DB.DATABASE_NAME'  ${INSTALL_ARGS} | awk -F= '{ print $2 }'`
 
@@ -288,12 +288,14 @@ then
 	then
     	export XAAUDIT_DB_JDBC_URL="jdbc:mysql://${audit_db_hostname}/${audit_db_name}"
     	export XAAUDIT_DB_JDBC_DRIVER="com.mysql.jdbc.Driver"
-	fi
-	
-	if [ "${db_flavor}" = "ORACLE" ]
+	elif [ "${db_flavor}" = "ORACLE" ]
 	then
     	export XAAUDIT_DB_JDBC_URL="jdbc:oracle:thin:\@//${audit_db_hostname}"
     	export XAAUDIT_DB_JDBC_DRIVER="oracle.jdbc.OracleDriver"
+    else
+        echo "Audit is not specified with a valid db_flavor: [${db_flavor}]. Ignoring audit ..."
+        export XAAUDIT_DB_JDBC_URL="jdbc:${db_flavor}://${audit_db_hostname}/${audit_db_name}"
+        export XAAUDIT_DB_JDBC_DRIVER="com.unknown.driver.${db_flavor}"
 	fi