TT#65907 Convert EXTRA_CONFIG_FILES from string to array to make shellcheck happy here

Otherwise:
> warning: Brace expansions and globs are literal in assignments. Quote it or use an array. [SC2125]

Change-Id: I5a209cc1b50cea37e13aef40dfbd86c6178b53dc
changes/49/33649/5
Alexander Lutay 6 years ago
parent 366101f5c2
commit 80ead123ab

@ -100,7 +100,7 @@ fi
if [ -d "${EXTRA_CONFIG_DIR:-}" ] && ls "${EXTRA_CONFIG_DIR}"/*.yml &>/dev/null ; then
log_debug "EXTRA_CONFIG_DIR is configured and *.yml files are present, setting EXTRA_CONFIG_FILES"
EXTRA_CONFIG_FILES="${EXTRA_CONFIG_DIR}"/*.yml
EXTRA_CONFIG_FILES=("${EXTRA_CONFIG_DIR}"/*.yml)
fi
## }}}

@ -116,7 +116,7 @@ else
fi
log_info "NOTE: Check those files for valid syntax and encoding:"
for f in "${input_file}" ${host_conf:-} ${local_conf:-} "$NGCPCTL_CONFIG" "${NETWORK_CONFIG:-}" ${EXTRA_CONFIG_FILES:-} "$CONSTANTS_CONFIG" ; do
for f in "${input_file}" ${host_conf:-} ${local_conf:-} "$NGCPCTL_CONFIG" "${NETWORK_CONFIG:-}" "${EXTRA_CONFIG_FILES[@]}" "$CONSTANTS_CONFIG" ; do
[ -r "$f" ] && log_info "$f"
done
log_info "Running /usr/share/ngcp-ngcpcfg/helper/tt2-wrapper <file>"

@ -50,7 +50,7 @@ rm -f "${NGCP_SOCKETFILE}"
"${HELPER}"/tt2-daemon
# Load all the configs in proper order and check their avialability and valid YAML syntax
for f in ${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES:-} ${CONSTANTS_CONFIG:-} ; do
for f in ${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do
if [ -r "$f" ] ; then
if ! "${HELPER}/tt2-wrapper" "/dev/null" "${f}" ; then
log_error "tt2-daemon cannot load ${f}:"
@ -85,15 +85,13 @@ else
trigger_rebuild=false
if [ -n "${EXTRA_CONFIG_FILES:-}" ] ; then
for file in $EXTRA_CONFIG_FILES ; do
if git diff-index --name-only HEAD | grep -qe -- "$(basename "$file")" ; then
log_debug "modification in EXTRA_CONFIG_FILES file $file found"
trigger_rebuild=true
break # no reason for further checks
fi
done
fi
for file in "${EXTRA_CONFIG_FILES[@]}" ; do
if git diff-index --name-only HEAD | grep -qe -- "$(basename "$file")" ; then
log_debug "modification in EXTRA_CONFIG_FILES file ${file} found"
trigger_rebuild=true
break # no reason for further checks
fi
done
if git diff-index --name-only HEAD | grep -q \
-e "$(basename "$NGCPCTL_CONFIG")" \
@ -151,7 +149,7 @@ killall tt2-daemon 2>/dev/null || true
rm -f "${NGCP_SOCKETFILE}"
# Apply configured file ownership and permissions
for f in ${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${EXTRA_CONFIG_FILES:-} ; do
for f in ${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ; do
if [ ! -f "${f}" ]; then
continue
fi

@ -229,7 +229,7 @@ check_shared_storage() {
}
if [ "$*" = "" ] ; then
config_files="${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES:-} ${CONSTANTS_CONFIG:-}"
config_files="${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES[*]} ${CONSTANTS_CONFIG:-}"
else
config_files="$*"
fi

@ -54,7 +54,7 @@ rm -f "${NGCP_SOCKETFILE}"
"${HELPER}"/tt2-daemon --quiet
# Load all the configs in proper order and check their avialability and valid YAML syntax
for f in ${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} ${EXTRA_CONFIG_FILES:-} ${CONSTANTS_CONFIG:-} ; do
for f in ${NGCPCTL_CONFIG:-} ${HOST_CONFIG:-} ${LOCAL_CONFIG:-} ${NETWORK_CONFIG:-} "${EXTRA_CONFIG_FILES[@]}" ${CONSTANTS_CONFIG:-} ; do
if [ -r "$f" ] ; then
if ! "${HELPER}/tt2-wrapper" "/dev/null" "${f}" ; then
log_error "tt2-daemon cannot load ${f}:"

Loading…
Cancel
Save