Commit 284595fe authored by James Nunez's avatar James Nunez Committed by Oleg Drokin
Browse files

LU-13960 tests: correct usage of _var variable

In the setmodopts() function in functions.sh, the '_var'
variable is set and used.  There is one use of the variable
'var' which should be '_var'.  Change the use of 'var' to
'_var'.

Reviewed-on: https://review.whamcloud.com/39891
(cherry picked from commit ff29ed8f

)

Test-Parameters: trivial
Test-Parameters: testlist=conf-sanity env=ONLY=53 clientdistro=ubuntu1804 fstype=ldiskfs
Test-Parameters: testlist=conf-sanity env=ONLY=53 clientdistro=el7.8 fstype=ldiskfs
Signed-off-by: default avatarJames Nunez <jnunez@whamcloud.com>
Change-Id: If524be1f0b4b2170a514a558256a5308c9a5e586
Reviewed-by: default avatarAndreas Dilger <adilger@whamcloud.com>
Reviewed-by: default avatarJohn L. Hammond <jhammond@whamcloud.com>
Reviewed-by: default avatarVikentsi Lapa <vlapa@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/39985

Tested-by: default avatarjenkins <devops@whamcloud.com>
Tested-by: default avatarMaloo <maloo@whamcloud.com>
parent 8f937ae2
......@@ -126,35 +126,35 @@ $msg"
#
# In the second usage the new value is appended to the old.
setmodopts() {
local _append=false
local _append=false
if [ "$1" = -a ]; then
_append=true
shift
fi
if [ "$1" = -a ]; then
_append=true
shift
fi
local _var=MODOPTS_$1
local _newvalue=$2
local _savevar=$3
local _oldvalue
local _var=MODOPTS_$1
local _newvalue=$2
local _savevar=$3
local _oldvalue
# Dynamic naming of variables is a pain in bash. In ksh93 we could
# write "nameref opts_var=${modname}_MODOPTS" then assign directly
# to opts_var. Associative arrays would also help, alternatively.
# Alas, we're stuck with eval until all distros move to a more recent
# version of bash. Fortunately we don't need to eval unset and export.
# Dynamic naming of variables is a pain in bash. In ksh93 we could
# write "nameref opts_var=${modname}_MODOPTS" then assign directly
# to opts_var. Associative arrays would also help, alternatively.
# Alas, we're stuck with eval until all distros move to a more recent
# version of bash. Fortunately we don't need to eval unset and export.
if [ -z "$_newvalue" ]; then
unset $_var
return 0
fi
if [ -z "$_newvalue" ]; then
unset $_var
return 0
fi
_oldvalue=${!var}
$_append && _newvalue="$_oldvalue $_newvalue"
export $_var="$_newvalue"
echo setmodopts: ${_var}=${_newvalue}
_oldvalue=${!_var}
$_append && _newvalue="$_oldvalue $_newvalue"
export $_var="$_newvalue"
echo setmodopts: ${_var}=${_newvalue}
[ -n "$_savevar" ] && eval $_savevar=\""$_oldvalue"\"
[ -n "$_savevar" ] && eval $_savevar=\""$_oldvalue"\"
}
echoerr () { echo "$@" 1>&2 ; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment