diff options
author | Jorge Hernandez <jh1730@att.com> | 2017-08-04 01:13:56 -0500 |
---|---|---|
committer | Jorge Hernandez <jh1730@att.com> | 2017-08-04 01:13:56 -0500 |
commit | 013b0e7f66eabb03fc238f17917579abfab3aade (patch) | |
tree | f6f0e93055736b0040beddf977548af23fc9a636 | |
parent | 9eb6ad5b26c1fd6d1f320c7a2c47448cd0449fd8 (diff) |
[POLICY-145] global name/value should be local
name/value is used in multiple places in installation script
with global scope since they are not tagged as local in
functions that manipulate it. A name value from another
called function causes a bad sideeffect in the healthcheck
module preventing from being expanded correctly.
Change-Id: I8ae092f421b79609b2eb7a3a55b4880e5d525a8d
Signed-off-by: Jorge Hernandez <jh1730@att.com>
-rw-r--r-- | policy-drools/docker-install.sh | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/policy-drools/docker-install.sh b/policy-drools/docker-install.sh index 281ace10..cedb2121 100644 --- a/policy-drools/docker-install.sh +++ b/policy-drools/docker-install.sh @@ -41,6 +41,8 @@ function POLICY_HOME() { set -x fi + local POLICY_HOME_ABS + if [[ -z ${POLICY_HOME} ]]; then echo "error: aborting installation: the installation directory POLICY_HOME must be set" exit 1 @@ -66,6 +68,8 @@ function check_java() { set -x fi + local TARGET_JAVA_VERSION INSTALLED_JAVA_VERSION + TARGET_JAVA_VERSION=$1 if [[ -z ${JAVA_HOME} ]]; then @@ -103,6 +107,8 @@ function process_configuration() { echo "-- ${FUNCNAME[0]} $@ --" set -x fi + + local CONF_FILE name value CONF_FILE=$1 while read line || [ -n "${line}" ]; do @@ -137,6 +143,8 @@ function configure_component() { echo "-- ${FUNCNAME[0]} $@ --" set -x fi + + local CONF_FILE COMPONENT_ROOT_DIR name value CONF_FILE=$1 COMPONENT_ROOT_DIR=$2 @@ -266,6 +274,8 @@ function install_prereqs() { echo "-- ${FUNCNAME[0]} $@ --" set -x fi + + local CONF_FILE HOME_OWNER CONF_FILE=$1 @@ -305,6 +315,8 @@ function configure_base() { echo "-- ${FUNCNAME[0]} $@ --" set -x fi + + local BASH_PROFILE_LINE PROFILE_LINE # check if fqdn is set in base.conf and use that value if set if [[ -z ${INSTALL_FQDN} ]] @@ -341,6 +353,8 @@ function install_base() { echo "-- ${FUNCNAME[0]} $@ --" set -x fi + + local POLICY_HOME_CONTENTS BASE_TGZ BASEX_TGZ BASH_PROFILE_LINE install_prereqs "${BASE_CONF}" @@ -439,7 +453,6 @@ function install_base() { # chmod -R 755 ${POLICY_HOME}/nagios > /dev/null 2>&1 - HOME_M2=$HOME/.m2 if [[ -d $HOME_M2 ]]; then echo "Renaming existing $HOME_M2 to $HOME/m2.$TIMESTAMP" mv $HOME_M2 $HOME/m2.$TIMESTAMP @@ -494,6 +507,8 @@ function install_controller() echo "error: aborting installation: ${POLICY_HOME}/etc/profile.d/env.sh is not accessible" exit 1 fi + + local CONTROLLER_CONF CONTROLLER_ZIP RULES_JAR SOURCE_DIR CONTROLLER_DIR AAAA BBBB PORT UTOPIC ARTIFACT_VERSION CONTROLLER_CONF=$COMPONENT_TYPE.conf install_prereqs "${CONTROLLER_CONF}" @@ -625,6 +640,8 @@ function update_monitor() { echo "-- ${FUNCNAME[0]} $@ --" set -x fi + + local NAME lastline NAME=$1 @@ -804,8 +821,9 @@ function installFeatures echo "-- ${FUNCNAME[0]} $@ --" set -x fi + + local name featureConf - FEATURES_HOME="${POLICY_HOME}/features" mkdir -p "${FEATURES_HOME}" > /dev/null 2>&1 if [[ -d "${FEATURES_HOME}" && -x "${FEATURES_HOME}" ]]; then SOURCE_DIR=$PWD @@ -873,5 +891,7 @@ LOGFILE=$PWD/install.log.$TIMESTAMP OPERATION=install BASE_CONF=base.conf +HOME_M2=$HOME/.m2 +FEATURES_HOME="${POLICY_HOME}/features" do_install 2>&1 | tee $LOGFILE |