Most of the pieces for kickstart support has already been in.
Resolves: rhbz#813998 --- kickstart.py | 7 ++++++- storage/devices.py | 5 ++++- storage/fcoe.py | 10 ++++++++-- 3 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/kickstart.py b/kickstart.py index bac6ab0..a180c8f 100644 --- a/kickstart.py +++ b/kickstart.py @@ -359,7 +359,12 @@ class Fcoe(commands.fcoe.F13_Fcoe): if fc.nic not in isys.getDeviceProperties(): raise KickstartValueError, formatErrorMsg(self.lineno, msg="Specified nonexistent nic %s in fcoe command" % fc.nic)
- storage.fcoe.fcoe().addSan(nic=fc.nic, dcb=fc.dcb, auto_vlan=True) + if fc.nic in (info[0] for info in storage.fcoe.fcoe().nics): + log.info("Kickstart fcoe device %s already added from EDD, ignoring" + % fc.nic) + else: + storage.fcoe.fcoe().addSan(nic=fc.nic, dcb=fc.dcb, auto_vlan=True) + storage.fcoe.fcoe().ksnics.append(fc.nic)
return fc
diff --git a/storage/devices.py b/storage/devices.py index 674ef5a..fdc4649 100644 --- a/storage/devices.py +++ b/storage/devices.py @@ -3715,7 +3715,10 @@ class FcoeDiskDevice(DiskDevice, NetworkStorageDevice): else: dcbOpt = "nodcb"
- return set(["fcoe=edd:%s" % dcbOpt]) + if nic in fcoe().ksnics: + return set(["fcoe=%s:%s" % (nic, dcbOpt)]) + else: + return set(["fcoe=edd:%s" % dcbOpt])
class OpticalDevice(StorageDevice): diff --git a/storage/fcoe.py b/storage/fcoe.py index 0841f79..4206726 100644 --- a/storage/fcoe.py +++ b/storage/fcoe.py @@ -60,6 +60,7 @@ class fcoe(object): self.started = False self.lldpadStarted = False self.nics = [] + self.ksnics = []
# So that users can write fcoe() to get the singleton instance def __call__(self): @@ -147,8 +148,13 @@ class fcoe(object): self.nics.append((nic, dcb, auto_vlan))
def writeKS(self, f): - # fixme plenty (including add ks support for fcoe in general) - return + for nic, dcb, auto_vlan in self.nics: + if nic in self.ksnics: + line = "fcoe --nic %s" % nic + if dcb: + line += " --dcb" + line += "\n" + f.write(line)
def write(self, instPath, anaconda): if not self.nics: