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

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