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'.
Test-Parameters: trivial
Test-Parameters: testlist=conf-sanity env=ONLY=53 clientdistro=ubuntu2004 fstype=ldiskfs
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: James Nunez <jnunez@whamcloud.com>
Change-Id: If524be1f0b4b2170a514a558256a5308c9a5e586
Reviewed-on: https://review.whamcloud.com/39891
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Vikentsi Lapa <vlapa@whamcloud.com>
#
# In the second usage the new value is appended to the old.
setmodopts() {
#
# In the second usage the new value is appended to the old.
setmodopts() {
- 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 ; }
}
echoerr () { echo "$@" 1>&2 ; }