Blame SOURCES/0039-Init-devlist-as-an-array.patch

5d5466
From 8063fd0f9e8abd718bd65928c19bc607cee5acd8 Mon Sep 17 00:00:00 2001
5d5466
From: Xiao Ni <xni@redhat.com>
5d5466
Date: Mon, 30 Sep 2019 19:47:59 +0800
5d5466
Subject: [RHEL7.8 PATCH V2 39/47] Init devlist as an array
5d5466
5d5466
devlist is an string. It will change to an array if there is disk that
5d5466
is sbd disk. If one device is sbd, it runs devlist=().
5d5466
This line code changes devlist from a string to an array. If there is
5d5466
no sbd device, it can't run this line code. So it will still be a string.
5d5466
The later codes need an array, rather than an string. So init devlist
5d5466
as an array to fix this problem.
5d5466
5d5466
Signed-off-by: Xiao Ni <xni@redhat.com>
5d5466
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
5d5466
---
5d5466
 clustermd_tests/func.sh | 3 +++
5d5466
 1 file changed, 3 insertions(+)
5d5466
5d5466
diff --git a/clustermd_tests/func.sh b/clustermd_tests/func.sh
5d5466
index 642cc96..801d604 100644
5d5466
--- a/clustermd_tests/func.sh
5d5466
+++ b/clustermd_tests/func.sh
5d5466
@@ -39,6 +39,9 @@ fetch_devlist()
5d5466
 		devlist=($(ls /dev/disk/by-path/*$ISCSI_ID*))
5d5466
 	fi
5d5466
 	# sbd disk cannot use in testing
5d5466
+	# Init devlist as an array
5d5466
+	i=''
5d5466
+	devlist=(${devlist[@]#$i})
5d5466
 	for i in ${devlist[@]}
5d5466
 	do
5d5466
 		sbd -d $i dump &> /dev/null
5d5466
-- 
5d5466
2.7.5
5d5466