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

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