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

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