ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [14/55] [abbrv] incubator-ranger git commit: RANGER-203: plugin-installtion script (enable-agent.sh) updated to read properties from <type>-plugin-install.properties file, in addition to install.properties.
Date Tue, 17 Feb 2015 08:16:47 GMT
RANGER-203: plugin-installtion script (enable-agent.sh) updated to read
properties from <type>-plugin-install.properties file, in addition to
install.properties.

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

Branch: refs/heads/master
Commit: 0b4363df72b1d3ea4c886d447c90fef507873e39
Parents: 760e5f7
Author: Madhan Neethiraj <madhan@apache.org>
Authored: Wed Feb 4 13:36:31 2015 -0800
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Wed Feb 4 13:36:31 2015 -0800

----------------------------------------------------------------------
 agents-common/scripts/enable-agent.sh | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ranger/blob/0b4363df/agents-common/scripts/enable-agent.sh
----------------------------------------------------------------------
diff --git a/agents-common/scripts/enable-agent.sh b/agents-common/scripts/enable-agent.sh
index ebaca12..727a827 100755
--- a/agents-common/scripts/enable-agent.sh
+++ b/agents-common/scripts/enable-agent.sh
@@ -16,7 +16,22 @@
 # limitations under the License.
 
 function getInstallProperty() {
-    grep "^$1" ${INSTALL_ARGS} | awk -F= '{  sub("^[ \t]*", "", $2); sub("[ \t]*$", "", $2);
print $2 }'
+    local propertyName=$1
+    local propertyValue=""
+
+    for file in "${COMPONENT_INSTALL_ARGS}" "${INSTALL_ARGS}"
+    do
+        if [ -f "${file}" ]
+        then
+            propertyValue=`grep "^${propertyName}" ${file} | awk -F= '{  sub("^[ \t]*", "",
$2); sub("[ \t]*$", "", $2); print $2 }'`
+            if [ "${propertyValue}" != "" ]
+            then
+                break
+            fi
+        fi
+    done
+
+    echo ${propertyValue}
 }
 
 #
@@ -103,6 +118,7 @@ DEFAULT_XML_CONFIG=${PROJ_INSTALL_DIR}/install/conf.templates/default/configurat
 PROJ_LIB_DIR=${PROJ_INSTALL_DIR}/lib
 PROJ_INSTALL_LIB_DIR="${PROJ_INSTALL_DIR}/install/lib"
 INSTALL_ARGS="${PROJ_INSTALL_DIR}/install.properties"
+COMPONENT_INSTALL_ARGS="${PROJ_INSTALL_DIR}/${COMPONENT_NAME}-install.properties"
 JAVA=$JAVA_HOME/bin/java
 
 HCOMPONENT_INSTALL_DIR_NAME=$(getInstallProperty 'COMPONENT_INSTALL_DIR_NAME')


Mime
View raw message