ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject incubator-argus git commit: ARGUS-187 trim whitespace(s) around = sign and after the property value in install.properties
Date Wed, 19 Nov 2014 22:03:11 GMT
Repository: incubator-argus
Updated Branches:
  refs/heads/master e902c5c9c -> cd0bfd917


ARGUS-187 trim whitespace(s) around = sign and after the property value in install.properties

Signed-off-by: Madhan Neethiraj <madhan@apache.org>


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

Branch: refs/heads/master
Commit: cd0bfd917725aac882fe0941f927fcdd9c545385
Parents: e902c5c
Author: Alok Lal <alal@hortonworks.com>
Authored: Tue Nov 18 17:41:06 2014 -0800
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Wed Nov 19 14:02:29 2014 -0800

----------------------------------------------------------------------
 agents-common/scripts/enable-agent.sh | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/cd0bfd91/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index e323fdb..8024b74 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -15,11 +15,13 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+function getInstallProperty() {
+    grep "^$1" ${INSTALL_ARGS} | awk -F= '{  sub("^[ \t]*", "", $2); sub("[ \t]*$", "", $2);
print $2 }'
+}
 
 #
 # Base env variable for Ranger related files/directories
 #
-
 PROJ_NAME=ranger
 BASE_CONF_DIR=/etc/${PROJ_NAME}
 
@@ -296,7 +298,7 @@ then
 	#
 	# Ensure that POLICY_CACHE_FILE_PATH is accessible
 	#
-	REPO_NAME=`grep '^REPOSITORY_NAME' ${INSTALL_ARGS} | awk -F= '{ print $2 }'`
+	REPO_NAME=$(getInstallProperty 'REPOSITORY_NAME')
 	export POLICY_CACHE_FILE_PATH=/etc/${PROJ_NAME}/${REPO_NAME}/policycache
 	export CREDENTIAL_PROVIDER_FILE=/etc/${PROJ_NAME}/${REPO_NAME}/cred.jceks
 	if [ ! -d ${POLICY_CACHE_FILE_PATH} ]
@@ -313,9 +315,9 @@ then
 	# We need to do the AUDIT JDBC url 
 	#
 
-	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
}'`
+	db_flavor=`echo $(getInstallProperty 'XAAUDIT.DB.FLAVOUR') | tr '[:lower:]' '[:upper:]'`
+    audit_db_hostname=$(getInstallProperty 'XAAUDIT.DB.HOSTNAME')
+    audit_db_name=$(getInstallProperty 'XAAUDIT.DB.DATABASE_NAME')
 
 	if [ "${db_flavor}" = "MYSQL" ]
 	then
@@ -405,7 +407,7 @@ then
 	if [ -d "${PROJ_LIB_DIR}" ]
 	then
 		dt=`date '+%Y%m%d%H%M%S'`
-		dbJar=`grep '^SQL_CONNECTOR_JAR' ${INSTALL_ARGS} | awk -F= '{ print $2 }'`
+		dbJar=$(getInstallProperty 'SQL_CONNECTOR_JAR')
 		for f in ${PROJ_LIB_DIR}/*.jar ${dbJar}
 		do
 			if [ -f "${f}" ]
@@ -457,7 +459,7 @@ then
 	
 	auditCredAlias="auditDBCred"
 	
-	auditdbCred=`grep '^XAAUDIT.DB.PASSWORD' ${INSTALL_ARGS} | awk -F= '{ print $2 }'`
+	auditdbCred=$(getInstallProperty 'XAAUDIT.DB.PASSWORD')
 	
 	create_jceks "${auditCredAlias}"  "${auditdbCred}"  "${CredFile}"
 	
@@ -469,14 +471,14 @@ then
 	
 	sslkeystoreAlias="sslKeyStore"
 	
-	sslkeystoreCred=`grep '^SSL_KEYSTORE_PASSWORD' ${INSTALL_ARGS} | awk -F= '{ print $2 }'`
+	sslkeystoreCred=$(getInstallProperty 'SSL_KEYSTORE_PASSWORD')
 	
 	create_jceks "${sslkeystoreAlias}" "${sslkeystoreCred}" "${CredFile}"
 	
 	
 	ssltruststoreAlias="sslTrustStore"
 	
-	ssltruststoreCred=`grep '^SSL_TRUSTSTORE_PASSWORD' ${INSTALL_ARGS} | awk -F= '{ print $2
}'`
+	ssltruststoreCred=$(getInstallProperty 'SSL_TRUSTSTORE_PASSWORD')
 	
 	create_jceks "${ssltruststoreAlias}" "${ssltruststoreCred}" "${CredFile}"
 	


Mime
View raw message