Don't write iscsi targets set up via ibft in generated ks (#811426)
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
" %(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("
")
+ nodes += " --reverse-password %s" % auth.reverse_password
+ nodes += "
"
+
+ if nodes:
+ f.write("iscsiname %s
" %(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@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
|