Blame SOURCES/bz1692413-2-iSCSILogicalUnit-create-acls-fix.patch

914f09
From 0d53e80957a00016418080967892337b1b13f99d Mon Sep 17 00:00:00 2001
914f09
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
914f09
Date: Tue, 30 Jul 2019 11:23:07 +0200
914f09
Subject: [PATCH] iSCSILogicalUnit: only create acls if it doesnt exist
914f09
914f09
---
914f09
 heartbeat/iSCSILogicalUnit.in | 4 ++--
914f09
 1 file changed, 2 insertions(+), 2 deletions(-)
914f09
914f09
diff --git a/heartbeat/iSCSILogicalUnit.in b/heartbeat/iSCSILogicalUnit.in
914f09
index 0fe85b593..02045d754 100644
914f09
--- a/heartbeat/iSCSILogicalUnit.in
914f09
+++ b/heartbeat/iSCSILogicalUnit.in
914f09
@@ -420,8 +420,8 @@ iSCSILogicalUnit_start() {
914f09
 
914f09
 		if [ -n "${OCF_RESKEY_allowed_initiators}" ]; then
914f09
 			for initiator in ${OCF_RESKEY_allowed_initiators}; do
914f09
-				ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/acls create ${initiator} add_mapped_luns=False || exit $OCF_ERR_GENERIC
914f09
-				ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/acls/${initiator} create ${OCF_RESKEY_lun} ${OCF_RESKEY_lun} || exit $OCF_ERR_GENERIC
914f09
+				[ -d "/sys/kernel/config/target/iscsi/${OCF_RESKEY_target_iqn}/tpgt_1/acls" ] || ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/acls create ${initiator} add_mapped_luns=False || exit $OCF_ERR_GENERIC
914f09
+				[ -d "/sys/kernel/config/target/iscsi/${OCF_RESKEY_target_iqn}/tpgt_1/acls/${initiator}" ] || ocf_run targetcli /iscsi/${OCF_RESKEY_target_iqn}/tpg1/acls/${initiator} create ${OCF_RESKEY_lun} ${OCF_RESKEY_lun} || exit $OCF_ERR_GENERIC
914f09
 			done
914f09
 		fi
914f09