Blame SOURCES/0335-iscsi-parse-iscsiroot.sh-only-set-initiator-name-if-.patch

712866
From eb87dc91d078ee942ef9c8bbc8e82f4ee4ccf0c6 Mon Sep 17 00:00:00 2001
712866
From: Harald Hoyer <harald@redhat.com>
712866
Date: Thu, 3 Sep 2015 12:41:06 +0200
712866
Subject: [PATCH] iscsi/parse-iscsiroot.sh: only set initiator-name, if not
712866
 empty
712866
712866
---
712866
 modules.d/95iscsi/parse-iscsiroot.sh | 14 ++++++++------
712866
 1 file changed, 8 insertions(+), 6 deletions(-)
712866
712866
diff --git a/modules.d/95iscsi/parse-iscsiroot.sh b/modules.d/95iscsi/parse-iscsiroot.sh
5c6c2a
index 6dd929f3..6aa14f5b 100755
712866
--- a/modules.d/95iscsi/parse-iscsiroot.sh
712866
+++ b/modules.d/95iscsi/parse-iscsiroot.sh
712866
@@ -118,12 +118,14 @@ fi
712866
 # If not given on the cmdline and initiator-name available via iBFT
712866
 if [ -z $iscsi_initiator ] && [ -f /sys/firmware/ibft/initiator/initiator-name ] && ! [ -f /tmp/iscsi_set_initiator ]; then
712866
     iscsi_initiator=$(while read line || [ -n "$line" ]; do echo $line;done < /sys/firmware/ibft/initiator/initiator-name)
712866
-    echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
712866
-    rm -f /etc/iscsi/initiatorname.iscsi
712866
-    mkdir -p /etc/iscsi
712866
-    ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
712866
-    > /tmp/iscsi_set_initiator
712866
-    systemctl try-restart iscsid && sleep 1
712866
+    if [ -n "$iscsi_initiator" ]; then
712866
+        echo "InitiatorName=$iscsi_initiator" > /run/initiatorname.iscsi
712866
+        rm -f /etc/iscsi/initiatorname.iscsi
712866
+        mkdir -p /etc/iscsi
712866
+        ln -fs /run/initiatorname.iscsi /etc/iscsi/initiatorname.iscsi
712866
+        > /tmp/iscsi_set_initiator
712866
+        systemctl try-restart iscsid && sleep 1
712866
+    fi
712866
 fi
712866
 
712866