From: Martin Schwenke Date: Wed, 6 Jul 2016 10:25:57 +0000 (+1000) Subject: ctdb-scripts: Avoid shellcheck warnings SC2119, SC2120 (function arguments) X-Git-Tag: tdb-1.3.10~266 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=987fd078d267a72ccddd6db2f197b8b30f52041e;p=thirdparty%2Fsamba.git ctdb-scripts: Avoid shellcheck warnings SC2119, SC2120 (function arguments) SC2119: Use FUNC "$@" if function's $1 should meanscript's $1. SC2120: FUNC references arguments, but none are ever passed. Signed-off-by: Martin Schwenke Reviewed-by: Amitay Isaacs --- diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper index 4d0dde7e0a9..367bc4a104a 100755 --- a/ctdb/config/ctdbd_wrapper +++ b/ctdb/config/ctdbd_wrapper @@ -114,6 +114,8 @@ dbdir_tmpfs_stop () fi } +# Only the nested function references its arguments +# shellcheck disable=SC2120 build_ctdb_options () { ctdb_options="" @@ -202,6 +204,8 @@ start() dbdir_tmpfs_start + # build_ctdb_options() takes no arguments + # shellcheck disable=SC2119 build_ctdb_options export_debug_variables diff --git a/ctdb/config/functions b/ctdb/config/functions index 3db3c8acbc0..2768d3f0487 100755 --- a/ctdb/config/functions +++ b/ctdb/config/functions @@ -759,6 +759,8 @@ _ctdb_counter_common () { _counter_file="${CTDB_SCRIPT_VARDIR}/failcount/${_service_name}" mkdir -p "${_counter_file%/*}" # dirname } +# Some code passes an argument +# shellcheck disable=SC2120 ctdb_counter_init () { _ctdb_counter_common "$1" @@ -849,6 +851,8 @@ ctdb_service_reconfigure () echo "Reconfiguring service \"${service_name}\"..." ctdb_service_unset_reconfigure service_reconfigure || return $? + # Intentionally have this use $service_name as default + # shellcheck disable=SC2119 ctdb_counter_init } @@ -1085,6 +1089,8 @@ ctdb_service_start () service_start || return $? + # Intentionally have this use $service_name as default + # shellcheck disable=SC2119 ctdb_counter_init ctdb_check_tcp_init }