]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Init devlist as an array
authorXiao Ni <xni@redhat.com>
Mon, 30 Sep 2019 11:47:59 +0000 (19:47 +0800)
committerJes Sorensen <jsorensen@fb.com>
Mon, 30 Sep 2019 19:26:44 +0000 (15:26 -0400)
devlist is an string. It will change to an array if there is disk that
is sbd disk. If one device is sbd, it runs devlist=().
This line code changes devlist from a string to an array. If there is
no sbd device, it can't run this line code. So it will still be a string.
The later codes need an array, rather than an string. So init devlist
as an array to fix this problem.

Signed-off-by: Xiao Ni <xni@redhat.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
clustermd_tests/func.sh

index 642cc966ef61d56d00bd777ec1abacc885dd3077..801d6043de61fc3bc4324925b4f9cbeda06f59f9 100644 (file)
@@ -39,6 +39,9 @@ fetch_devlist()
                devlist=($(ls /dev/disk/by-path/*$ISCSI_ID*))
        fi
        # sbd disk cannot use in testing
+       # Init devlist as an array
+       i=''
+       devlist=(${devlist[@]#$i})
        for i in ${devlist[@]}
        do
                sbd -d $i dump &> /dev/null