From a1ed7e64b60e809fad567f34837d3550fc5fafbf Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Wed, 29 May 2019 22:16:50 -0400 Subject: [PATCH] Fix SC2086 for lines 700 until EOF Double quote to prevent globbing and word splitting Change-Id: Ic34ae97f05b8e6180d91ccd5479e1cd56ee52e44 Signed-off-by: Thanh Ha --- jjb/integration/common-functions.sh | 44 ++++++++++++++++------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/jjb/integration/common-functions.sh b/jjb/integration/common-functions.sh index c3fdb54a8..ac9e5dfbc 100644 --- a/jjb/integration/common-functions.sh +++ b/jjb/integration/common-functions.sh @@ -704,7 +704,7 @@ function join() { final=${final}${delim}${str} done - echo ${final} + echo "${final}" } function get_nodes_list() { @@ -715,11 +715,11 @@ function get_nodes_list() { done nodes_list=$(join "${nodes[@]}") - echo ${nodes_list} + echo "${nodes_list}" } function get_features() { - if [ ${CONTROLLERSCOPE} == 'all' ]; then + if [ "${CONTROLLERSCOPE}" == 'all' ]; then ACTUALFEATURES="odl-integration-compatible-with-all,${CONTROLLERFEATURES}" export CONTROLLERMEM="3072m" else @@ -742,7 +742,7 @@ function get_features() { # Create the configuration script to be run on controllers. function create_configuration_script() { - cat > ${WORKSPACE}/configuration-script.sh < "${WORKSPACE}"/configuration-script.sh < ${WORKSPACE}/startup-script.sh < "${WORKSPACE}"/startup-script.sh < ${WORKSPACE}/post-startup-script.sh < "${WORKSPACE}"/post-startup-script.sh < ${WORKSPACE}/ps_before.log - pid=$(grep org.apache.karaf.main.Main ${WORKSPACE}/ps_before.log | grep -v grep | tr -s ' ' | cut -f2 -d' ') + ssh "${!CONTROLLERIP}" "sudo ps aux" > "${WORKSPACE}"/ps_before.log + pid=$(grep org.apache.karaf.main.Main "${WORKSPACE}"/ps_before.log | grep -v grep | tr -s ' ' | cut -f2 -d' ') echo "karaf main: org.apache.karaf.main.Main, pid:${pid}" - ssh ${!CONTROLLERIP} "${JAVA_HOME}/bin/jstack -l ${pid}" > ${WORKSPACE}/karaf_${i}_${pid}_threads_before.log || true + # $i needs to be parsed client-side + # shellcheck disable=SC2029 + ssh "${!CONTROLLERIP}" "${JAVA_HOME}/bin/jstack -l ${pid}" > "${WORKSPACE}/karaf_${i}_${pid}_threads_before.log" || true done } -- 2.36.6