The [2/2] requires new build of pykickstart. I can push the patches today if they get review ack.
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:
Resolves: rhbz#813998 --- anaconda.spec.in | 2 +- kickstart.py | 2 +- storage/fcoe.py | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in index cbe065d..f2fb625 100644 --- a/anaconda.spec.in +++ b/anaconda.spec.in @@ -27,7 +27,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) %define intltoolver 0.31.2-3 %define libnlver 1.0 %define libselinuxver 1.6 -%define pykickstartver 1.74.11 +%define pykickstartver 1.74.12 %define rpmpythonver 4.2-0.61 %define slangver 2.0.6-2 %define yumver 2.9.2 diff --git a/kickstart.py b/kickstart.py index a180c8f..c5d331c 100644 --- a/kickstart.py +++ b/kickstart.py @@ -363,7 +363,7 @@ class Fcoe(commands.fcoe.F13_Fcoe): 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().addSan(nic=fc.nic, dcb=fc.dcb, auto_vlan=fc.autovlan) storage.fcoe.fcoe().ksnics.append(fc.nic)
return fc diff --git a/storage/fcoe.py b/storage/fcoe.py index 4206726..75c932b 100644 --- a/storage/fcoe.py +++ b/storage/fcoe.py @@ -153,6 +153,8 @@ class fcoe(object): line = "fcoe --nic %s" % nic if dcb: line += " --dcb" + if auto_vlan: + line += " --autovlan" line += "\n" f.write(line)
I forgot one piece, attached.
Resolves: rhbz#813998 --- pykickstart/commands/fcoe.py | 25 +++++++++++++++++++++++++ pykickstart/handlers/control.py | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/pykickstart/commands/fcoe.py b/pykickstart/commands/fcoe.py index 3320849..cf0ff04 100644 --- a/pykickstart/commands/fcoe.py +++ b/pykickstart/commands/fcoe.py @@ -64,6 +64,22 @@ class F13_FcoeData(F12_FcoeData):
return retval
+class RHEL6_FcoeData(F13_FcoeData): + removedKeywords = F13_FcoeData.removedKeywords + removedAttrs = F13_FcoeData.removedAttrs + + def __init__(self, *args, **kwargs): + F13_FcoeData.__init__(self, *args, **kwargs) + self.autovlan = kwargs.get("autovlan", False) + + def _getArgsAsStr(self): + retval = F13_FcoeData._getArgsAsStr(self) + + if self.autovlan: + retval += " --autovlan" + + return retval + class F12_Fcoe(KickstartCommand): removedKeywords = KickstartCommand.removedKeywords removedAttrs = KickstartCommand.removedAttrs @@ -112,3 +128,12 @@ class F13_Fcoe(F12_Fcoe): op = F12_Fcoe._getParser(self) op.add_option("--dcb", dest="dcb", action="store_true", default=False) return op + +class RHEL6_Fcoe(F13_Fcoe): + removedKeywords = F13_Fcoe.removedKeywords + removedAttrs = F13_Fcoe.removedAttrs + + def _getParser(self): + op = F13_Fcoe._getParser(self) + op.add_option("--autovlan", dest="autovlan", action="store_true", default=False) + return op diff --git a/pykickstart/handlers/control.py b/pykickstart/handlers/control.py index cf24586..3f9ebe7 100644 --- a/pykickstart/handlers/control.py +++ b/pykickstart/handlers/control.py @@ -823,7 +823,7 @@ commandMap = { "deviceprobe": deviceprobe.FC3_DeviceProbe, "dmraid": dmraid.FC6_DmRaid, "driverdisk": driverdisk.F12_DriverDisk, - "fcoe": fcoe.F13_Fcoe, + "fcoe": fcoe.RHEL6_Fcoe, "firewall": firewall.F10_Firewall, "firstboot": firstboot.FC3_Firstboot, "graphical": displaymode.FC3_DisplayMode, @@ -1066,7 +1066,7 @@ dataMap = { "DriverDiskData": driverdisk.F12_DriverDiskData, "DeviceData": device.F8_DeviceData, "DmRaidData": dmraid.FC6_DmRaidData, - "FcoeData": fcoe.F13_FcoeData, + "FcoeData": fcoe.RHEL6_FcoeData, "GroupData": group.F12_GroupData, "IscsiData": iscsi.RHEL6_IscsiData, "LogVolData": logvol.RHEL6_LogVolData,
anaconda-patches@lists.fedorahosted.org