Blame SOURCES/0008-Copy-the-iSCSI-initiator-name-file-to-the-installed-system.patch

3187bc
From 653a3df662d10d0c8cc7f34138efd89a61f531a3 Mon Sep 17 00:00:00 2001
3187bc
From: Vojtech Trefny <vtrefny@redhat.com>
3187bc
Date: Wed, 9 Jan 2019 13:03:49 +0100
3187bc
Subject: [PATCH] Copy the iSCSI initiator name file to the installed system
3187bc
3187bc
The initiatorname.iscsi file is used (sometimes) during boot so
3187bc
we need to write the configuration to the installed system.
3187bc
3187bc
Resolves: rhbz#1664587
3187bc
---
3187bc
 blivet/iscsi.py | 5 +++++
3187bc
 1 file changed, 5 insertions(+)
3187bc
3187bc
diff --git a/blivet/iscsi.py b/blivet/iscsi.py
3187bc
index 3e44e6ed..f053577d 100644
3187bc
--- a/blivet/iscsi.py
3187bc
+++ b/blivet/iscsi.py
3187bc
@@ -563,6 +563,11 @@ def write(self, root, storage):  # pylint: disable=unused-argument
3187bc
             shutil.copytree("/var/lib/iscsi", root + "/var/lib/iscsi",
3187bc
                             symlinks=True)
3187bc
 
3187bc
+        # copy the initiator file too
3187bc
+        if not os.path.isdir(root + "/etc/iscsi"):
3187bc
+            os.makedirs(root + "/etc/iscsi", 0o755)
3187bc
+        shutil.copyfile(INITIATOR_FILE, root + INITIATOR_FILE)
3187bc
+
3187bc
     def get_node(self, name, address, port, iface):
3187bc
         for node in self.active_nodes():
3187bc
             if node.name == name and node.address == address and \