Add an command to activate FCoE attached SAN's from kickstart --- pykickstart/commands/fcoe.py | 69 +++++++++++++++++++++++++++++++++++++++ pykickstart/handlers/control.py | 1 + 2 files changed, 70 insertions(+), 0 deletions(-) create mode 100644 pykickstart/commands/fcoe.py diff --git a/pykickstart/commands/fcoe.py b/pykickstart/commands/fcoe.py new file mode 100644 index 0000000..b3c01bd --- /dev/null +++ b/pykickstart/commands/fcoe.py @@ -0,0 +1,69 @@ +# +# Hans de Goede <hdegoede@xxxxxxxxxx> +# +# Copyright 2009 Red Hat, Inc. +# +# This copyrighted material is made available to anyone wishing to use, modify, +# copy, or redistribute it subject to the terms and conditions of the GNU +# General Public License v.2. This program is distributed in the hope that it +# will be useful, but WITHOUT ANY WARRANTY expressed or implied, including the +# implied warranties of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# this program; if not, write to the Free Software Foundation, Inc., 51 +# Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Any Red Hat +# trademarks that are incorporated in the source code or documentation are not +# subject to the GNU General Public License and may only be used or replicated +# with the express permission of Red Hat, Inc. +# +from pykickstart.base import * +from pykickstart.options import * + +class F12_FcoeData(BaseData): + removedKeywords = BaseData.removedKeywords + removedAttrs = BaseData.removedAttrs + + def __init__(self, *args, **kwargs): + BaseData.__init__(self, *args, **kwargs) + self.nic = kwargs.get("nic", None) + + def __str__(self): + retval = BaseData.__str__(self) + retval += "fcoe" + + if self.nic: + retval += " --nic=%s" % self.nic + + return retval + "\n" + + +class F12_Fcoe(KickstartCommand): + removedKeywords = KickstartCommand.removedKeywords + removedAttrs = KickstartCommand.removedAttrs + + def __init__(self, writePriority=0, *args, **kwargs): + KickstartCommand.__init__(self, writePriority, *args, **kwargs) + self.op = self._getParser() + self.fcoe = kwargs.get("fcoe", []) + + def __str__(self): + retval = "" + for fcoe in self.fcoe: + retval += fcoe.__str__() + + return retval + + def _getParser(self): + op = KSOptionParser() + op.add_option("--nic", dest="nic", required=1) + return op + + def parse(self, args): + zd = self.handler.FcoeData() + (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) + self._setToObj(self.op, opts, zd) + return zd + + def dataList(self): + return self.fcoe diff --git a/pykickstart/handlers/control.py b/pykickstart/handlers/control.py index 8e1ab66..be6d6f3 100644 --- a/pykickstart/handlers/control.py +++ b/pykickstart/handlers/control.py @@ -541,6 +541,7 @@ commandMap = { "deviceprobe": deviceprobe.FC3_DeviceProbe, "dmraid": dmraid.FC6_DmRaid, "driverdisk": driverdisk.FC3_DriverDisk, + "fcoe": fcoe.F12_Fcoe, "firewall": firewall.F10_Firewall, "firstboot": firstboot.FC3_Firstboot, "graphical": displaymode.FC3_DisplayMode, -- 1.6.2.2 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list