YARN-7318. Fix shell check warnings of SLS. (Gergely Novák via wangda)

This commit is contained in:
Wangda Tan 2017-10-20 15:54:01 -07:00
parent f36cbc8475
commit 281d83604d
2 changed files with 6 additions and 0 deletions

View File

@ -60,6 +60,8 @@ function calculate_classpath()
function run_sls_generator() function run_sls_generator()
{ {
local args
if [[ -z "${outputprefix}" ]] ; then if [[ -z "${outputprefix}" ]] ; then
outputprefix="sls" outputprefix="sls"
fi fi
@ -88,6 +90,7 @@ HADOOP_LIBEXEC_DIR="${HADOOP_LIBEXEC_DIR:-$HADOOP_DEFAULT_LIBEXEC_DIR}"
# shellcheck disable=SC2034 # shellcheck disable=SC2034
HADOOP_NEW_CONFIG=true HADOOP_NEW_CONFIG=true
if [[ -f "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]]; then if [[ -f "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]]; then
# shellcheck disable=SC1090
. "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" . "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh"
else else
echo "ERROR: Cannot execute ${HADOOP_LIBEXEC_DIR}/hadoop-config.sh." 2>&1 echo "ERROR: Cannot execute ${HADOOP_LIBEXEC_DIR}/hadoop-config.sh." 2>&1

View File

@ -81,6 +81,8 @@ function calculate_classpath
function run_simulation() { function run_simulation() {
local args
if [[ "${inputsls}" != "" ]] ; then if [[ "${inputsls}" != "" ]] ; then
hadoop_add_param args -inputsls "-inputsls ${inputsls}" hadoop_add_param args -inputsls "-inputsls ${inputsls}"
fi fi
@ -126,6 +128,7 @@ HADOOP_LIBEXEC_DIR="${HADOOP_LIBEXEC_DIR:-$HADOOP_DEFAULT_LIBEXEC_DIR}"
# shellcheck disable=SC2034 # shellcheck disable=SC2034
HADOOP_NEW_CONFIG=true HADOOP_NEW_CONFIG=true
if [[ -f "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]]; then if [[ -f "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" ]]; then
# shellcheck disable=SC1090
. "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh" . "${HADOOP_LIBEXEC_DIR}/hadoop-config.sh"
else else
echo "ERROR: Cannot execute ${HADOOP_LIBEXEC_DIR}/hadoop-config.sh." 2>&1 echo "ERROR: Cannot execute ${HADOOP_LIBEXEC_DIR}/hadoop-config.sh." 2>&1