[PATCH 2/2 rhel6-branch] Don't write iscsi targets set up via ibft in generated ks (#811426)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Originally this fix is related to #500273.

Related: rhbz#811426
---
 storage/iscsi.py |   25 ++++++++++++++++---------
 1 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/storage/iscsi.py b/storage/iscsi.py
index 122590b..51f9c68 100644
--- a/storage/iscsi.py
+++ b/storage/iscsi.py
@@ -405,23 +405,30 @@ class iscsi(object):
         self.stabilize(intf)
 
     def writeKS(self, f):
+
         if not self.initiatorSet:
             return
-        f.write("iscsiname %s\n" %(self.initiator,))
+
+        nodes = ""
         for n in self.active_nodes():
-            f.write("iscsi --ipaddr %s --port %s --target %s" %
-                    (n.address, n.port, n.name))
+            if n in self.ibftNodes:
+                continue
+            nodes += "iscsi --ipaddr %s --port %s --target %s" % (n.address, n.port, n.name)
             if n.iface != "default":
-                f.write(" --iface %s" % self.ifaces[n.iface])
+                nodes += " --iface %s" % self.ifaces[n.iface]
             auth = n.getAuth()
             if auth:
-                f.write(" --user %s" % auth.username)
-                f.write(" --password %s" % auth.password)
+                nodes += " --user %s" % auth.username
+                nodes += " --password %s" % auth.password
                 if len(auth.reverse_username):
-                    f.write(" --reverse-user %s" % auth.reverse_username)
+                    nodes += " --reverse-user %s" % auth.reverse_username
                 if len(auth.reverse_password):
-                    f.write(" --reverse-password %s" % auth.reverse_password)
-            f.write("\n")
+                    nodes += " --reverse-password %s" % auth.reverse_password
+            nodes += "\n"
+
+        if nodes:
+            f.write("iscsiname %s\n" %(self.initiator,))
+            f.write("%s" % nodes)
 
     def write(self, instPath, anaconda):
         if not self.initiatorSet:
-- 
1.7.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux