neil / rpms / python-blivet

Forked from rpms/python-blivet a year ago
Clone

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

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