From b6ae106b5d28180a5890e837c87f3e91e5917638 Mon Sep 17 00:00:00 2001 From: Tom Zanussi Date: Mon, 4 Aug 2014 08:36:24 -0500 Subject: wic: Remove unused 3rdparty/commands wic doesn't use anything but partition and bootloader, so remove the rest. Signed-off-by: Tom Zanussi --- .../mic/3rdparty/pykickstart/commands/__init__.py | 8 +- .../3rdparty/pykickstart/commands/authconfig.py | 40 - .../mic/3rdparty/pykickstart/commands/autopart.py | 119 --- .../mic/3rdparty/pykickstart/commands/autostep.py | 55 - .../mic/3rdparty/pykickstart/commands/clearpart.py | 86 -- .../mic/3rdparty/pykickstart/commands/device.py | 125 --- .../3rdparty/pykickstart/commands/deviceprobe.py | 40 - .../3rdparty/pykickstart/commands/displaymode.py | 68 -- .../mic/3rdparty/pykickstart/commands/dmraid.py | 91 -- .../3rdparty/pykickstart/commands/driverdisk.py | 184 ---- .../lib/mic/3rdparty/pykickstart/commands/fcoe.py | 114 -- .../mic/3rdparty/pykickstart/commands/firewall.py | 193 ---- .../mic/3rdparty/pykickstart/commands/firstboot.py | 62 -- .../lib/mic/3rdparty/pykickstart/commands/group.py | 88 -- .../3rdparty/pykickstart/commands/ignoredisk.py | 139 --- .../3rdparty/pykickstart/commands/interactive.py | 58 -- .../lib/mic/3rdparty/pykickstart/commands/iscsi.py | 133 --- .../mic/3rdparty/pykickstart/commands/iscsiname.py | 54 - .../lib/mic/3rdparty/pykickstart/commands/key.py | 64 -- .../mic/3rdparty/pykickstart/commands/keyboard.py | 55 - .../lib/mic/3rdparty/pykickstart/commands/lang.py | 60 -- .../3rdparty/pykickstart/commands/langsupport.py | 58 -- .../mic/3rdparty/pykickstart/commands/lilocheck.py | 54 - .../mic/3rdparty/pykickstart/commands/logging.py | 66 -- .../mic/3rdparty/pykickstart/commands/logvol.py | 304 ------ .../3rdparty/pykickstart/commands/mediacheck.py | 53 - .../mic/3rdparty/pykickstart/commands/method.py | 186 ---- .../mic/3rdparty/pykickstart/commands/monitor.py | 106 -- .../lib/mic/3rdparty/pykickstart/commands/mouse.py | 70 -- .../mic/3rdparty/pykickstart/commands/multipath.py | 111 -- .../mic/3rdparty/pykickstart/commands/network.py | 363 ------- .../lib/mic/3rdparty/pykickstart/commands/raid.py | 365 ------- .../mic/3rdparty/pykickstart/commands/reboot.py | 79 -- .../lib/mic/3rdparty/pykickstart/commands/repo.py | 249 ----- .../mic/3rdparty/pykickstart/commands/rescue.py | 68 -- .../mic/3rdparty/pykickstart/commands/rootpw.py | 93 -- .../mic/3rdparty/pykickstart/commands/selinux.py | 64 -- .../mic/3rdparty/pykickstart/commands/services.py | 71 -- .../lib/mic/3rdparty/pykickstart/commands/skipx.py | 54 - .../lib/mic/3rdparty/pykickstart/commands/sshpw.py | 105 -- .../mic/3rdparty/pykickstart/commands/timezone.py | 86 -- .../mic/3rdparty/pykickstart/commands/updates.py | 60 -- .../mic/3rdparty/pykickstart/commands/upgrade.py | 106 -- .../lib/mic/3rdparty/pykickstart/commands/user.py | 173 ---- .../lib/mic/3rdparty/pykickstart/commands/vnc.py | 114 -- .../mic/3rdparty/pykickstart/commands/volgroup.py | 102 -- .../mic/3rdparty/pykickstart/commands/xconfig.py | 184 ---- .../mic/3rdparty/pykickstart/commands/zerombr.py | 69 -- .../lib/mic/3rdparty/pykickstart/commands/zfcp.py | 134 --- .../mic/3rdparty/pykickstart/handlers/control.py | 1092 -------------------- 50 files changed, 1 insertion(+), 6474 deletions(-) delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/device.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/group.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsi.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/iscsiname.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/key.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/keyboard.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/lang.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/langsupport.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/lilocheck.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/logging.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/logvol.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/mediacheck.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/method.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/monitor.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/mouse.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/multipath.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/network.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/raid.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/reboot.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/repo.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/rescue.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/rootpw.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/selinux.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/services.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/skipx.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/sshpw.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/timezone.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/updates.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/upgrade.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/user.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/vnc.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/volgroup.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/xconfig.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/zerombr.py delete mode 100644 scripts/lib/mic/3rdparty/pykickstart/commands/zfcp.py (limited to 'scripts') diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/__init__.py b/scripts/lib/mic/3rdparty/pykickstart/commands/__init__.py index da48ff50d5..2d94550935 100644 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/__init__.py +++ b/scripts/lib/mic/3rdparty/pykickstart/commands/__init__.py @@ -17,10 +17,4 @@ # subject to the GNU General Public License and may only be used or replicated # with the express permission of Red Hat, Inc. # -import authconfig, autopart, autostep, bootloader, clearpart, device -import deviceprobe, displaymode, dmraid, driverdisk, fcoe, firewall, firstboot -import group, ignoredisk, interactive, iscsi, iscsiname, key, keyboard, lang -import langsupport, lilocheck, logging, logvol, mediacheck, method, monitor -import mouse, multipath, network, partition, raid, reboot, repo, rescue, rootpw -import selinux, services, skipx, sshpw, timezone, updates, upgrade, user, vnc -import volgroup, xconfig, zerombr, zfcp +import bootloader, partition diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py b/scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py deleted file mode 100644 index 9af9c0ff14..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/authconfig.py +++ /dev/null @@ -1,40 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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 * - -class FC3_Authconfig(KickstartCommand): - removedKeywords = KickstartCommand.removedKeywords - removedAttrs = KickstartCommand.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - KickstartCommand.__init__(self, *args, **kwargs) - self.authconfig = kwargs.get("authconfig", "") - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.authconfig: - retval += "# System authorization information\nauth %s\n" % self.authconfig - - return retval - - def parse(self, args): - self.authconfig = self.currentLine[len(self.currentCmd):].strip() - return self diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py b/scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py deleted file mode 100644 index cf28b5c7f7..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/autopart.py +++ /dev/null @@ -1,119 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007, 2008 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.errors import * -from pykickstart.options import * - -import gettext -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class FC3_AutoPart(KickstartCommand): - removedKeywords = KickstartCommand.removedKeywords - removedAttrs = KickstartCommand.removedAttrs - - def __init__(self, writePriority=100, *args, **kwargs): - KickstartCommand.__init__(self, writePriority, *args, **kwargs) - self.autopart = kwargs.get("autopart", False) - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.autopart: - retval += "autopart\n" - - return retval - - def parse(self, args): - if len(args) > 0: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % "autopart") - - self.autopart = True - return self - -class F9_AutoPart(FC3_AutoPart): - removedKeywords = FC3_AutoPart.removedKeywords - removedAttrs = FC3_AutoPart.removedAttrs - - def __init__(self, writePriority=100, *args, **kwargs): - FC3_AutoPart.__init__(self, writePriority=writePriority, *args, **kwargs) - self.encrypted = kwargs.get("encrypted", False) - self.passphrase = kwargs.get("passphrase", "") - - self.op = self._getParser() - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.autopart: - retval += "autopart" - - if self.encrypted: - retval += " --encrypted" - - if self.passphrase != "": - retval += " --passphrase=\"%s\""% self.passphrase - - if retval != "": - retval += "\n" - - return retval - - def _getParser(self): - op = KSOptionParser() - op.add_option("--encrypted", action="store_true", default=False) - op.add_option("--passphrase") - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - self._setToSelf(self.op, opts) - self.autopart = True - return self - -class F12_AutoPart(F9_AutoPart): - removedKeywords = F9_AutoPart.removedKeywords - removedAttrs = F9_AutoPart.removedAttrs - - def __init__(self, writePriority=100, *args, **kwargs): - F9_AutoPart.__init__(self, writePriority=writePriority, *args, **kwargs) - - self.escrowcert = kwargs.get("escrowcert", "") - self.backuppassphrase = kwargs.get("backuppassphrase", False) - - def __str__(self): - retval = F9_AutoPart.__str__(self) - - if self.encrypted and self.escrowcert != "": - retval = retval.strip() - - retval += " --escrowcert=\"%s\"" % self.escrowcert - - if self.backuppassphrase: - retval += " --backuppassphrase" - - retval += "\n" - - return retval - - def _getParser(self): - op = F9_AutoPart._getParser(self) - op.add_option("--escrowcert") - op.add_option("--backuppassphrase", action="store_true", default=False) - return op diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py b/scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py deleted file mode 100644 index e6ae71cefc..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/autostep.py +++ /dev/null @@ -1,55 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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 FC3_AutoStep(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.autostep = kwargs.get("autostep", False) - self.autoscreenshot = kwargs.get("autoscreenshot", False) - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.autostep: - if self.autoscreenshot: - retval += "autostep --autoscreenshot\n" - else: - retval += "autostep\n" - - return retval - - def _getParser(self): - op = KSOptionParser() - op.add_option("--autoscreenshot", dest="autoscreenshot", - action="store_true", default=False) - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - self._setToSelf(self.op, opts) - self.autostep = True - return self diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py b/scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py deleted file mode 100644 index a8089fcb99..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/clearpart.py +++ /dev/null @@ -1,86 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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.constants import * -from pykickstart.errors import * -from pykickstart.options import * - -class FC3_ClearPart(KickstartCommand): - removedKeywords = KickstartCommand.removedKeywords - removedAttrs = KickstartCommand.removedAttrs - - def __init__(self, writePriority=120, *args, **kwargs): - KickstartCommand.__init__(self, writePriority, *args, **kwargs) - self.op = self._getParser() - - self.drives = kwargs.get("drives", []) - self.initAll = kwargs.get("initAll", False) - self.type = kwargs.get("type", None) - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.type is None: - return retval - - if self.type == CLEARPART_TYPE_NONE: - clearstr = "--none" - elif self.type == CLEARPART_TYPE_LINUX: - clearstr = "--linux" - elif self.type == CLEARPART_TYPE_ALL: - clearstr = "--all" - else: - clearstr = "" - - if self.initAll: - initstr = "--initlabel" - else: - initstr = "" - - if len(self.drives) > 0: - drivestr = "--drives=" + ",".join(self.drives) - else: - drivestr = "" - - retval += "# Partition clearing information\nclearpart %s %s %s\n" % (clearstr, initstr, drivestr) - return retval - - def _getParser(self): - def drive_cb (option, opt_str, value, parser): - for d in value.split(','): - parser.values.ensure_value(option.dest, []).append(d) - - op = KSOptionParser() - op.add_option("--all", dest="type", action="store_const", - const=CLEARPART_TYPE_ALL) - op.add_option("--drives", dest="drives", action="callback", - callback=drive_cb, nargs=1, type="string") - op.add_option("--initlabel", dest="initAll", action="store_true", - default=False) - op.add_option("--linux", dest="type", action="store_const", - const=CLEARPART_TYPE_LINUX) - op.add_option("--none", dest="type", action="store_const", - const=CLEARPART_TYPE_NONE) - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - self._setToSelf(self.op, opts) - return self diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/device.py b/scripts/lib/mic/3rdparty/pykickstart/commands/device.py deleted file mode 100644 index 321410e2e2..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/device.py +++ /dev/null @@ -1,125 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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 * - -import gettext -import warnings -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class F8_DeviceData(BaseData): - removedKeywords = BaseData.removedKeywords - removedAttrs = BaseData.removedAttrs - - def __init__(self, *args, **kwargs): - BaseData.__init__(self, *args, **kwargs) - self.moduleName = kwargs.get("moduleName", "") - self.moduleOpts = kwargs.get("moduleOpts", "") - - def __eq__(self, y): - return self.moduleName == y.moduleName - - def __str__(self): - retval = BaseData.__str__(self) - - if self.moduleName != "": - retval += "device %s" % self.moduleName - - if self.moduleOpts != "": - retval += " --opts=\"%s\"" % self.moduleOpts - - return retval + "\n" - -class FC3_Device(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.type = kwargs.get("type", "") - self.moduleName = kwargs.get("moduleName", "") - self.moduleOpts = kwargs.get("moduleOpts", "") - - def __eq__(self, y): - return self.moduleName == y.moduleName - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.moduleName != "": - retval += "device %s %s" % (self.type, self.moduleName) - - if self.moduleOpts != "": - retval += " --opts=\"%s\"" % self.moduleOpts - - return retval + "\n" - - def _getParser(self): - op = KSOptionParser() - op.add_option("--opts", dest="moduleOpts", default="") - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - - if len(extra) != 2: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("device command requires two arguments: module type and name")) - - self.moduleOpts = opts.moduleOpts - self.type = extra[0] - self.moduleName = extra[1] - return self - -class F8_Device(FC3_Device): - removedKeywords = FC3_Device.removedKeywords - removedAttrs = FC3_Device.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - FC3_Device.__init__(self, writePriority, *args, **kwargs) - self.deviceList = kwargs.get("deviceList", []) - - def __str__(self): - retval = "" - for device in self.deviceList: - retval += device.__str__() - - return retval - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - - if len(extra) != 1: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("%s command requires a single argument: %s") % ("device", "module name")) - - dd = F8_DeviceData() - self._setToObj(self.op, opts, dd) - dd.lineno = self.lineno - dd.moduleName = extra[0] - - # Check for duplicates in the data list. - if dd in self.dataList(): - warnings.warn(_("A module with the name %s has already been defined.") % dd.moduleName) - - return dd - - def dataList(self): - return self.deviceList diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py b/scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py deleted file mode 100644 index 9f462fdff7..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/deviceprobe.py +++ /dev/null @@ -1,40 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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 * - -class FC3_DeviceProbe(KickstartCommand): - removedKeywords = KickstartCommand.removedKeywords - removedAttrs = KickstartCommand.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - KickstartCommand.__init__(self, writePriority, *args, **kwargs) - self.deviceprobe = kwargs.get("deviceprobe", "") - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.deviceprobe != "": - retval += "deviceprobe %s\n" % self.deviceprobe - - return retval - - def parse(self, args): - self.deviceprobe = " ".join(args) - return self diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py b/scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py deleted file mode 100644 index 6a12d58ec2..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/displaymode.py +++ /dev/null @@ -1,68 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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.constants import * -from pykickstart.options import * - -import gettext -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class FC3_DisplayMode(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.displayMode = kwargs.get("displayMode", None) - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.displayMode is None: - return retval - - if self.displayMode == DISPLAY_MODE_CMDLINE: - retval += "cmdline\n" - elif self.displayMode == DISPLAY_MODE_GRAPHICAL: - retval += "# Use graphical install\ngraphical\n" - elif self.displayMode == DISPLAY_MODE_TEXT: - retval += "# Use text mode install\ntext\n" - - return retval - - def _getParser(self): - op = KSOptionParser() - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - - if len(extra) > 0: - raise KickstartParseError, formatErrorMsg(self.lineno, msg=_("Kickstart command %s does not take any arguments") % self.currentCmd) - - if self.currentCmd == "cmdline": - self.displayMode = DISPLAY_MODE_CMDLINE - elif self.currentCmd == "graphical": - self.displayMode = DISPLAY_MODE_GRAPHICAL - elif self.currentCmd == "text": - self.displayMode = DISPLAY_MODE_TEXT - - return self diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py b/scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py deleted file mode 100644 index 993575a041..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/dmraid.py +++ /dev/null @@ -1,91 +0,0 @@ -# -# Chris Lumens -# Peter Jones -# -# Copyright 2006, 2007 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.errors import * -from pykickstart.options import * - -import gettext -import warnings -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class FC6_DmRaidData(BaseData): - removedKeywords = BaseData.removedKeywords - removedAttrs = BaseData.removedAttrs - - def __init__(self, *args, **kwargs): - BaseData.__init__(self, *args, **kwargs) - - self.name = kwargs.get("name", "") - self.devices = kwargs.get("devices", []) - self.dmset = kwargs.get("dmset", None) - - def __eq__(self, y): - return self.name == y.name and self.devices == y.devices - - def __str__(self): - retval = BaseData.__str__(self) - retval += "dmraid --name=%s" % self.name - - for dev in self.devices: - retval += " --dev=\"%s\"" % dev - - return retval + "\n" - -class FC6_DmRaid(KickstartCommand): - removedKeywords = KickstartCommand.removedKeywords - removedAttrs = KickstartCommand.removedAttrs - - def __init__(self, writePriority=60, *args, **kwargs): - KickstartCommand.__init__(self, writePriority, *args, **kwargs) - self.op = self._getParser() - - self.dmraids = kwargs.get("dmraids", []) - - def __str__(self): - retval = "" - for dm in self.dmraids: - retval += dm.__str__() - - return retval - - def _getParser(self): - op = KSOptionParser() - op.add_option("--name", dest="name", action="store", type="string", - required=1) - op.add_option("--dev", dest="devices", action="append", type="string", - required=1) - return op - - def parse(self, args): - dm = FC6_DmRaidData() - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - dm.name = dm.name.split('/')[-1] - self._setToObj(self.op, opts, dm) - dm.lineno = self.lineno - - # Check for duplicates in the data list. - if dm in self.dataList(): - warnings.warn(_("A DM RAID device with the name %s and devices %s has already been defined.") % (dm.name, dm.devices)) - - return dm - - def dataList(self): - return self.dmraids diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py b/scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py deleted file mode 100644 index 82a58c0e28..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/driverdisk.py +++ /dev/null @@ -1,184 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007, 2008 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 * - -import gettext -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class FC3_DriverDiskData(BaseData): - removedKeywords = BaseData.removedKeywords - removedAttrs = BaseData.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - BaseData.__init__(self, *args, **kwargs) - - self.partition = kwargs.get("partition", "") - self.source = kwargs.get("source", "") - self.type = kwargs.get("type", "") - - def _getArgsAsStr(self): - retval = "" - - if self.partition: - retval += "%s" % self.partition - - if hasattr(self, "type") and self.type: - retval += " --type=%s" % self.type - elif self.source: - retval += "--source=%s" % self.source - return retval - - def __str__(self): - retval = BaseData.__str__(self) - retval += "driverdisk %s\n" % self._getArgsAsStr() - return retval - -class FC4_DriverDiskData(FC3_DriverDiskData): - removedKeywords = FC3_DriverDiskData.removedKeywords - removedAttrs = FC3_DriverDiskData.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - FC3_DriverDiskData.__init__(self, *args, **kwargs) - self.deleteRemovedAttrs() - - self.biospart = kwargs.get("biospart", "") - - def _getArgsAsStr(self): - retval = "" - - if self.partition: - retval += "%s" % self.partition - - if hasattr(self, "type") and self.type: - retval += " --type=%s" % self.type - elif self.source: - retval += "--source=%s" % self.source - elif self.biospart: - retval += "--biospart=%s" % self.biospart - - return retval - -class F12_DriverDiskData(FC4_DriverDiskData): - removedKeywords = FC4_DriverDiskData.removedKeywords + ["type"] - removedAttrs = FC4_DriverDiskData.removedAttrs + ["type"] - - def __init__(self, *args, **kwargs): - FC4_DriverDiskData.__init__(self, *args, **kwargs) - self.deleteRemovedAttrs() - -F14_DriverDiskData = F12_DriverDiskData - -class FC3_DriverDisk(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.driverdiskList = kwargs.get("driverdiskList", []) - - def __str__(self): - retval = "" - for dd in self.driverdiskList: - retval += dd.__str__() - - return retval - - def _getParser(self): - op = KSOptionParser() - op.add_option("--source") - op.add_option("--type") - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - - if len(extra) > 1: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one partition may be specified for driverdisk command.")) - - if len(extra) == 1 and opts.source: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one of --source and partition may be specified for driverdisk command.")) - - if not extra and not opts.source: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("One of --source or partition must be specified for driverdisk command.")) - - ddd = self.handler.DriverDiskData() - self._setToObj(self.op, opts, ddd) - ddd.lineno = self.lineno - if len(extra) == 1: - ddd.partition = extra[0] - - return ddd - - def dataList(self): - return self.driverdiskList - -class FC4_DriverDisk(FC3_DriverDisk): - removedKeywords = FC3_DriverDisk.removedKeywords - removedAttrs = FC3_DriverDisk.removedKeywords - - def _getParser(self): - op = FC3_DriverDisk._getParser(self) - op.add_option("--biospart") - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - - if len(extra) > 1: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one partition may be specified for driverdisk command.")) - - if len(extra) == 1 and opts.source: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one of --source and partition may be specified for driverdisk command.")) - elif len(extra) == 1 and opts.biospart: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one of --biospart and partition may be specified for driverdisk command.")) - elif opts.source and opts.biospart: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Only one of --biospart and --source may be specified for driverdisk command.")) - - if not extra and not opts.source and not opts.biospart: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("One of --source, --biospart, or partition must be specified for driverdisk command.")) - - ddd = self.handler.DriverDiskData() - self._setToObj(self.op, opts, ddd) - ddd.lineno = self.lineno - if len(extra) == 1: - ddd.partition = extra[0] - - return ddd - -class F12_DriverDisk(FC4_DriverDisk): - removedKeywords = FC4_DriverDisk.removedKeywords - removedAttrs = FC4_DriverDisk.removedKeywords - - def _getParser(self): - op = FC4_DriverDisk._getParser(self) - op.add_option("--type", deprecated=1) - return op - -class F14_DriverDisk(F12_DriverDisk): - removedKeywords = F12_DriverDisk.removedKeywords - removedAttrs = F12_DriverDisk.removedKeywords - - def _getParser(self): - op = F12_DriverDisk._getParser(self) - op.remove_option("--type") - return op diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py b/scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py deleted file mode 100644 index 33208499b3..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/fcoe.py +++ /dev/null @@ -1,114 +0,0 @@ -# -# Hans de Goede -# -# 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 * - -import gettext -import warnings -_ = lambda x: gettext.ldgettext("pykickstart", x) - -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 __eq__(self, y): - return self.nic == y.nic - - def _getArgsAsStr(self): - retval = "" - - if self.nic: - retval += " --nic=%s" % self.nic - - return retval - - def __str__(self): - retval = BaseData.__str__(self) - retval += "fcoe%s\n" % self._getArgsAsStr() - return retval - -class F13_FcoeData(F12_FcoeData): - removedKeywords = F12_FcoeData.removedKeywords - removedAttrs = F12_FcoeData.removedAttrs - - def __init__(self, *args, **kwargs): - F12_FcoeData.__init__(self, *args, **kwargs) - self.dcb = kwargs.get("dcb", False) - - def _getArgsAsStr(self): - retval = F12_FcoeData._getArgsAsStr(self) - - if self.dcb: - retval += " --dcb" - - return retval - -class F12_Fcoe(KickstartCommand): - removedKeywords = KickstartCommand.removedKeywords - removedAttrs = KickstartCommand.removedAttrs - - def __init__(self, writePriority=71, *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) - if len(extra) > 0: - mapping = {"command": "fcoe", "options": extra} - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Unexpected arguments to %(command)s command: %(options)s") % mapping) - - self._setToObj(self.op, opts, zd) - zd.lineno = self.lineno - - # Check for duplicates in the data list. - if zd in self.dataList(): - warnings.warn(_("A FCOE device with the name %s has already been defined.") % zd.nic) - - return zd - - def dataList(self): - return self.fcoe - -class F13_Fcoe(F12_Fcoe): - removedKeywords = F12_Fcoe.removedKeywords - removedAttrs = F12_Fcoe.removedAttrs - - def _getParser(self): - op = F12_Fcoe._getParser(self) - op.add_option("--dcb", dest="dcb", action="store_true", default=False) - return op diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py b/scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py deleted file mode 100644 index 24a01bd610..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/firewall.py +++ /dev/null @@ -1,193 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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.errors import * -from pykickstart.options import * - -import gettext -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class FC3_Firewall(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.enabled = kwargs.get("enabled", None) - self.ports = kwargs.get("ports", []) - self.trusts = kwargs.get("trusts", []) - - def __str__(self): - extra = [] - filteredPorts = [] - - retval = KickstartCommand.__str__(self) - - if self.enabled is None: - return retval - - if self.enabled: - # It's possible we have words in the ports list instead of - # port:proto (s-c-kickstart may do this). So, filter those - # out into their own list leaving what we expect. - for port in self.ports: - if port == "ssh": - extra.append(" --ssh") - elif port == "telnet": - extra.append(" --telnet") - elif port == "smtp": - extra.append(" --smtp") - elif port == "http": - extra.append(" --http") - elif port == "ftp": - extra.append(" --ftp") - else: - filteredPorts.append(port) - - # All the port:proto strings go into a comma-separated list. - portstr = ",".join(filteredPorts) - if len(portstr) > 0: - portstr = " --port=" + portstr - else: - portstr = "" - - extrastr = "".join(extra) - truststr = ",".join(self.trusts) - - if len(truststr) > 0: - truststr = " --trust=" + truststr - - # The output port list consists only of port:proto for - # everything that we don't recognize, and special options for - # those that we do. - retval += "# Firewall configuration\nfirewall --enabled%s%s%s\n" % (extrastr, portstr, truststr) - else: - retval += "# Firewall configuration\nfirewall --disabled\n" - - return retval - - def _getParser(self): - def firewall_port_cb (option, opt_str, value, parser): - for p in value.split(","): - p = p.strip() - if p.find(":") == -1: - p = "%s:tcp" % p - parser.values.ensure_value(option.dest, []).append(p) - - op = KSOptionParser(mapping={"ssh":["22:tcp"], "telnet":["23:tcp"], - "smtp":["25:tcp"], "http":["80:tcp", "443:tcp"], - "ftp":["21:tcp"]}) - - op.add_option("--disable", "--disabled", dest="enabled", - action="store_false") - op.add_option("--enable", "--enabled", dest="enabled", - action="store_true", default=True) - op.add_option("--ftp", "--http", "--smtp", "--ssh", "--telnet", - dest="ports", action="map_extend") - op.add_option("--high", deprecated=1) - op.add_option("--medium", deprecated=1) - op.add_option("--port", dest="ports", action="callback", - callback=firewall_port_cb, nargs=1, type="string") - op.add_option("--trust", dest="trusts", action="append") - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - - if len(extra) != 0: - mapping = {"command": "firewall", "options": extra} - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("Unexpected arguments to %(command)s command: %(options)s") % mapping) - - self._setToSelf(self.op, opts) - return self - -class F9_Firewall(FC3_Firewall): - removedKeywords = FC3_Firewall.removedKeywords - removedAttrs = FC3_Firewall.removedAttrs - - def _getParser(self): - op = FC3_Firewall._getParser(self) - op.remove_option("--high") - op.remove_option("--medium") - return op - -class F10_Firewall(F9_Firewall): - removedKeywords = F9_Firewall.removedKeywords - removedAttrs = F9_Firewall.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - F9_Firewall.__init__(self, writePriority, *args, **kwargs) - self.services = kwargs.get("services", []) - - def __str__(self): - if self.enabled is None: - return "" - - retval = F9_Firewall.__str__(self) - if self.enabled: - retval = retval.strip() - - svcstr = ",".join(self.services) - if len(svcstr) > 0: - svcstr = " --service=" + svcstr - else: - svcstr = "" - - return retval + "%s\n" % svcstr - else: - return retval - - def _getParser(self): - def service_cb (option, opt_str, value, parser): - # python2.4 does not support action="append_const" that we were - # using for these options. Instead, we have to fake it by - # appending whatever the option string is to the service list. - if not value: - parser.values.ensure_value(option.dest, []).append(opt_str[2:]) - return - - for p in value.split(","): - p = p.strip() - parser.values.ensure_value(option.dest, []).append(p) - - op = F9_Firewall._getParser(self) - op.add_option("--service", dest="services", action="callback", - callback=service_cb, nargs=1, type="string") - op.add_option("--ftp", dest="services", action="callback", - callback=service_cb) - op.add_option("--http", dest="services", action="callback", - callback=service_cb) - op.add_option("--smtp", dest="services", action="callback", - callback=service_cb) - op.add_option("--ssh", dest="services", action="callback", - callback=service_cb) - op.add_option("--telnet", deprecated=1) - return op - -class F14_Firewall(F10_Firewall): - removedKeywords = F10_Firewall.removedKeywords + ["telnet"] - removedAttrs = F10_Firewall.removedAttrs + ["telnet"] - - def _getParser(self): - op = F10_Firewall._getParser(self) - op.remove_option("--telnet") - return op diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py b/scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py deleted file mode 100644 index 05c0ac11c6..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/firstboot.py +++ /dev/null @@ -1,62 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007 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.constants import * -from pykickstart.options import * - -class FC3_Firstboot(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.firstboot = kwargs.get("firstboot", None) - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if self.firstboot is None: - return retval - - if self.firstboot == FIRSTBOOT_SKIP: - retval += "firstboot --disable\n" - elif self.firstboot == FIRSTBOOT_DEFAULT: - retval += "# Run the Setup Agent on first boot\nfirstboot --enable\n" - elif self.firstboot == FIRSTBOOT_RECONFIG: - retval += "# Run the Setup Agent on first boot\nfirstboot --reconfig\n" - - return retval - - def _getParser(self): - op = KSOptionParser() - op.add_option("--disable", "--disabled", dest="firstboot", - action="store_const", const=FIRSTBOOT_SKIP) - op.add_option("--enable", "--enabled", dest="firstboot", - action="store_const", const=FIRSTBOOT_DEFAULT) - op.add_option("--reconfig", dest="firstboot", action="store_const", - const=FIRSTBOOT_RECONFIG) - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - self.firstboot = opts.firstboot - return self diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/group.py b/scripts/lib/mic/3rdparty/pykickstart/commands/group.py deleted file mode 100644 index 80ba5bdca6..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/group.py +++ /dev/null @@ -1,88 +0,0 @@ -# -# Chris Lumens -# -# 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.constants import * -from pykickstart.errors import * -from pykickstart.options import * - -import gettext -import warnings -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class F12_GroupData(BaseData): - removedKeywords = BaseData.removedKeywords - removedAttrs = BaseData.removedAttrs - - def __init__(self, *args, **kwargs): - BaseData.__init__(self, *args, **kwargs) - self.name = kwargs.get("name", "") - self.gid = kwargs.get("gid", None) - - def __eq__(self, y): - return self.name == y.name - - def __str__(self): - retval = BaseData.__str__(self) - retval += "group" - - if self.name: - retval += " --name=%s" % self.name - if self.gid: - retval += " --gid=%s" % self.gid - - return retval + "\n" - -class F12_Group(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.groupList = kwargs.get("groupList", []) - - def __str__(self): - retval = "" - for user in self.groupList: - retval += user.__str__() - - return retval - - def _getParser(self): - op = KSOptionParser() - op.add_option("--name", required=1) - op.add_option("--gid", type="int") - return op - - def parse(self, args): - gd = self.handler.GroupData() - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - self._setToObj(self.op, opts, gd) - gd.lineno = self.lineno - - # Check for duplicates in the data list. - if gd in self.dataList(): - warnings.warn(_("A group with the name %s has already been defined.") % gd.name) - - return gd - - def dataList(self): - return self.groupList diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py b/scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py deleted file mode 100644 index 676d080836..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/ignoredisk.py +++ /dev/null @@ -1,139 +0,0 @@ -# -# Chris Lumens -# -# Copyright 2005, 2006, 2007, 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 * - -import gettext -_ = lambda x: gettext.ldgettext("pykickstart", x) - -class FC3_IgnoreDisk(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.ignoredisk = kwargs.get("ignoredisk", []) - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if len(self.ignoredisk) > 0: - retval += "ignoredisk --drives=%s\n" % ",".join(self.ignoredisk) - - return retval - - def _getParser(self): - def drive_cb (option, opt_str, value, parser): - for d in value.split(','): - parser.values.ensure_value(option.dest, []).append(d) - - op = KSOptionParser() - op.add_option("--drives", dest="ignoredisk", action="callback", - callback=drive_cb, nargs=1, type="string", required=1) - return op - - def parse(self, args): - (opts, extra) = self.op.parse_args(args=args, lineno=self.lineno) - self._setToSelf(self.op, opts) - return self - -class F8_IgnoreDisk(FC3_IgnoreDisk): - removedKeywords = FC3_IgnoreDisk.removedKeywords - removedAttrs = FC3_IgnoreDisk.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - FC3_IgnoreDisk.__init__(self, writePriority, *args, **kwargs) - - self.onlyuse = kwargs.get("onlyuse", []) - - def __str__(self): - retval = KickstartCommand.__str__(self) - - if len(self.ignoredisk) > 0: - retval += "ignoredisk --drives=%s\n" % ",".join(self.ignoredisk) - elif len(self.onlyuse) > 0: - retval += "ignoredisk --only-use=%s\n" % ",".join(self.onlyuse) - - return retval - - def parse(self, args, errorCheck=True): - retval = FC3_IgnoreDisk.parse(self, args) - - if errorCheck: - if (len(self.ignoredisk) == 0 and len(self.onlyuse) == 0) or (len(self.ignoredisk) > 0 and (len(self.onlyuse) > 0)): - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("One of --drives or --only-use must be specified for ignoredisk command.")) - - return retval - - def _getParser(self): - def drive_cb (option, opt_str, value, parser): - for d in value.split(','): - parser.values.ensure_value(option.dest, []).append(d) - - op = FC3_IgnoreDisk._getParser(self) - op.add_option("--drives", dest="ignoredisk", action="callback", - callback=drive_cb, nargs=1, type="string") - op.add_option("--only-use", dest="onlyuse", action="callback", - callback=drive_cb, nargs=1, type="string") - return op - -class RHEL6_IgnoreDisk(F8_IgnoreDisk): - removedKeywords = F8_IgnoreDisk.removedKeywords - removedAttrs = F8_IgnoreDisk.removedAttrs - - def __init__(self, writePriority=0, *args, **kwargs): - F8_IgnoreDisk.__init__(self, writePriority, *args, **kwargs) - - self.interactive = kwargs.get("interactive", False) - if self.interactive: - self.ignoredisk = [] - - def __str__(self): - retval = F8_IgnoreDisk.__str__(self) - - if self.interactive: - retval = "ignoredisk --interactive\n" - - return retval - - def parse(self, args): - retval = F8_IgnoreDisk.parse(self, args, errorCheck=False) - - howmany = 0 - if len(self.ignoredisk) > 0: - howmany += 1 - if len(self.onlyuse) > 0: - howmany += 1 - if self.interactive: - howmany += 1 - if howmany != 1: - raise KickstartValueError, formatErrorMsg(self.lineno, msg=_("One of --drives , --only-use , or --interactive must be specified for ignoredisk command.")) - - return retval - - def _getParser(self): - op = F8_IgnoreDisk._getParser(self) - op.add_option("--interactive", dest="interactive", action="store_true", - default=False) - return op - -F14_IgnoreDisk = RHEL6_IgnoreDisk diff --git a/scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py b/scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py deleted file mode 100644 index fa3dc025b1..0000000000 --- a/scripts/lib/mic/3rdparty/pykickstart/commands/interactive.py +++ /dev/null @@ -1,58 +0,0 @@ -# -# Chris Lumens