mdadm/test: use the first element of array as parsing condition
it would complain "too many arguments" when array[] has few members, it's proper to check whether or not array[0] is null. Reported-by: Xiao Ni <xni@redhat.com> Signed-off-by: Zhilong Liu <zlliu@suse.com> Signed-off-by: Jes Sorensen <jsorensen@fb.com>
This commit is contained in:
parent
8cc56e8b32
commit
3af7f2adc0
2
test
2
test
|
@ -75,7 +75,7 @@ save_log() {
|
|||
echo
|
||||
elif [ "$DEVTYPE" == 'loop' -o "$DEVTYPE" == 'disk' ]
|
||||
then
|
||||
if [ ! -z ${array[@]} -a ${#array[@]} -ge 1 ]
|
||||
if [ ! -z "$array" -a ${#array[@]} -ge 1 ]
|
||||
then
|
||||
md_disks=($($mdadm -D -Y ${array[@]} | grep "/dev/" | cut -d'=' -f2))
|
||||
cat /proc/mdstat | grep -q "bitmap"
|
||||
|
|
Loading…
Reference in New Issue