Shellcheck seems to think that [ -z "$debug" ] is setting the debug
variable and warns:
common/multipath-over-rdma:190:11: note: Modification of debug is local (to subshell caused by pipeline). [SC2030]
common/multipath-over-rdma:606:8: note: debug was modified in a subshell. That change might be lost. [SC2031]
Work around this by using test instead.
Signed-off-by: Omar Sandoval <osandov@fb.com>
echo -n "removing $mpdev: "
if ! remove_mpath_dev "$mpdev"; then
echo "failed"
- [ -z "$debug" ] || return 1
+ test -z "$debug" || return 1
fi
done
echo "Finished examining multipaths"