-__version__ = '3.31'
+__version__ = '3.41'
a subclass is used, a warning message will be
printed.
+ RemovedCommand - an abstract subclass of KickstartCommand that should
+ be subclassed to update the description with the version
+ it was removed in.
+ Any use of the command will raise an error.
+
KickstartCommand - The base abstract class for all kickstart commands.
Command objects are contained within a BaseHandler
object.
"""
from pykickstart.i18n import _
-import six
import warnings
from pykickstart import __version__
from pykickstart.errors import KickstartParseError, KickstartParseWarning, KickstartDeprecationWarning
"""Print a warning message if the command is seen in the input file."""
mapping = {"lineno": self.lineno, "cmd": self.currentCmd}
warnings.warn(_("Ignoring deprecated command on line %(lineno)s: The %(cmd)s command has been deprecated and no longer has any effect. It may be removed from future releases, which will result in a fatal error from kickstart. Please modify your kickstart file to remove this command.") % mapping, KickstartDeprecationWarning)
+ return None
+
+class RemovedCommand(KickstartCommand):
+ """Specify that a command has been removed and no longer has any function.
+ Any command that is removed should be subclassed from this class, and
+ should set its description to add the version that the command was removed in.
+ This is an abstract class.
+ """
+ def __init__(self, writePriority=None, *args, **kwargs):
+ # We don't want people using this class by itself.
+ if self.__class__ is RemovedCommand:
+ raise TypeError("RemovedCommand is an abstract class.")
+
+ # Create a new RemovedCommand instance.
+ KickstartCommand.__init__(self, writePriority, *args, **kwargs)
+
+ def dataList(self):
+ """Override the method of the removed command."""
+ return None
+
+ @property
+ def dataClass(self):
+ """Override the attribute of the removed command."""
+ return None
+
+ def __str__(self):
+ """Placeholder since RemovedCommands don't work anymore."""
+ return ""
+
+ def parse(self, args):
+ """Raise an error if the command is found in the input file"""
+ raise KickstartParseError(_("%s has been removed.") % self.currentCmd, lineno=self.lineno)
###
### HANDLERS
for prio in lst:
for obj in self._writeOrder[prio]:
- obj_str = obj.__str__()
- if isinstance(obj_str, six.text_type) and not six.PY3:
- obj_str = obj_str.encode("utf-8")
- retval += obj_str
+ retval += obj.__str__()
return retval
def _insertSorted(self, lst, obj):
+ def cmdName(cmdObj):
+ if cmdObj.__class__.__name__.find("_") != -1:
+ return cmdObj.__class__.__name__.split("_", 1)[1]
+ else:
+ return cmdObj.__class__.__name__
+
length = len(lst)
i = 0
# If the two classes have the same name, it's because we are
# overriding an existing class with one from a later kickstart
# version, so remove the old one in favor of the new one.
- if obj.__class__.__name__ > lst[i].__class__.__name__:
+ if cmdName(obj) > cmdName(lst[i]):
i += 1
- elif obj.__class__.__name__ == lst[i].__class__.__name__:
+ elif cmdName(obj) == cmdName(lst[i]):
lst[i] = obj
return
- elif obj.__class__.__name__ < lst[i].__class__.__name__:
+ elif cmdName(obj) < cmdName(lst[i]):
break
if i >= length:
# off the version part from the front of the name.
if cmdObj.__class__.__name__.find("_") != -1:
name = cmdObj.__class__.__name__.split("_", 1)[1]
- if not six.PY3:
- name = unicode(name) # pylint: disable=undefined-variable
else:
name = cmdObj.__class__.__name__.lower()
- if not six.PY3:
- name = unicode(name) # pylint: disable=undefined-variable
setattr(self, name.lower(), cmdObj)
retval += KickstartHandler.__str__(self)
for script in self.scripts:
- script_str = script.__str__()
- if isinstance(script_str, six.text_type) and not six.PY3:
- script_str = script_str.encode("utf-8")
- retval += script_str
+ retval += script.__str__()
if self._null_section_strings:
retval += "\n"
# 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.
+# with the express permission of Red Hat, Inc.
#
import warnings
from textwrap import dedent
from pykickstart.errors import KickstartDeprecationWarning
-from pykickstart.version import FC3, versionToLongString, F28
-from pykickstart.base import KickstartCommand
+from pykickstart.version import FC3, versionToLongString, F28, F35
+from pykickstart.base import KickstartCommand, RemovedCommand
from pykickstart.options import KSOptionParser
""" % versionToLongString(F28))
return op
+
+class F35_Authconfig(RemovedCommand, F28_Authconfig):
+ def _getParser(self):
+ op = F28_Authconfig._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F35)
+ return op
Partitioning scheme 'btrfs' was removed.""" % versionToLongString(RHEL8)
return op
+
+
+class RHEL9_AutoPart(RHEL8_AutoPart):
+ pass
+
# with the express permission of Red Hat, Inc.
#
from pykickstart.version import RHEL5, RHEL6, versionToLongString
-from pykickstart.version import FC3, FC4, F8, F12, F14, F15, F17, F18, F19, F21, F29
-from pykickstart.base import KickstartCommand
+from pykickstart.version import FC3, FC4, F8, F12, F14, F15, F17, F18, F19, F21, F29, F34
+from pykickstart.base import KickstartCommand, RemovedCommand
from pykickstart.errors import KickstartParseError
from pykickstart.options import KSOptionParser, commaSplit
def _getParser(self):
op = super(FC3_Lilo, self)._getParser()
op.prog = "lilo"
- op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC4)
+ return op
+
+class FC4_Lilo(RemovedCommand, FC3_Lilo):
+ def _getParser(self):
+ op = FC3_Lilo._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(FC4)
return op
If given, the password specified by ``--password=`` is
already encrypted and should be passed to the bootloader
configuration without additional modification.""")
- op.add_argument("--md5pass", dest="_md5pass", version=F15, help="""
- If using GRUB, similar to ``--password=`` except the password
- should already be encrypted.""")
+ op.add_argument("--md5pass", dest="_md5pass", metavar="MD5PASS", version=F15,
+ help="Alias for ``--password=MD5PASS --iscrypted``.")
return op
def parse(self, args):
If given, the password specified by ``--password=`` is
already encrypted and should be passed to the bootloader
configuration without additional modification.""")
- op.add_argument("--md5pass", dest="_md5pass", version=RHEL6, help="""
- If using GRUB, similar to ``--password=`` except the
- password should already be encrypted.""")
+ op.add_argument("--md5pass", dest="_md5pass", metavar="MD5PASS", version=RHEL6,
+ help="Alias for ``--password=MD5PASS --iscrypted``.")
return op
def parse(self, args):
class RHEL8_Bootloader(F29_Bootloader):
pass
+
+class F34_Bootloader(F29_Bootloader):
+ removedKeywords = F29_Bootloader.removedKeywords
+ removedAttrs = F29_Bootloader.removedAttrs
+
+ def _getParser(self):
+ op = F29_Bootloader._getParser(self)
+ op.remove_argument("--upgrade", version=F34)
+ return op
+
+class RHEL9_Bootloader(F34_Bootloader):
+ pass
op = F23_BTRFS._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(RHEL8)
return op
+
+class RHEL9_BTRFS(RHEL8_BTRFS):
+ pass
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import FC3, F17, F21, F28
+from pykickstart.version import FC3, F17, F21, F25, F28
from pykickstart.base import KickstartCommand
from pykickstart.constants import CLEARPART_TYPE_ALL, CLEARPART_TYPE_LINUX, CLEARPART_TYPE_LIST, CLEARPART_TYPE_NONE
from pykickstart.options import KSOptionParser, commaSplit
and gpt for x86_64 but not dasd.""")
return op
-class F28_ClearPart(F21_ClearPart):
+class F25_ClearPart(F21_ClearPart):
+ def _getParser(self):
+ op = super(F25_ClearPart, self)._getParser()
+ op.add_argument("--drives", type=commaSplit, version=F25, help="""
+ The following clears the partitions on the first
+ two drives on the system:
+
+ ``clearpart --drives=sda,sdb``
+
+ or clear as many drives as it could and skip the missing
+ (at least one must be matched):
+
+ ``clearpart --drives=sda|sdb1``
+
+ or clear all virtio drives and only first scsi device if
+ exists
+
+ ``clearpart --drives=sda|vd*``""")
+ op.add_argument("--list", dest="devices", type=commaSplit,
+ version=F25, help="""
+ The following clears the partitions on the first
+ two drives on the system:
+
+ ``clearpart --list=sda,sdb``
+
+ or clear as many drives as it could and skip the missing
+ (at least one must be matched):
+
+ ``clearpart --list=sda|sdb1``
+
+ or clear all virtio drives and only first scsi device if
+ exists
+
+ ``clearpart --list=sda|vd*``""")
+ return op
+
+class F28_ClearPart(F25_ClearPart):
def __init__(self, *args, **kwargs):
super(F28_ClearPart, self).__init__(*args, **kwargs)
self.cdl = kwargs.get("cdl", False)
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import versionToLongString, FC3, F24
-from pykickstart.base import BaseData, DeprecatedCommand, KickstartCommand
+from pykickstart.version import versionToLongString, FC3, F24, F34
+from pykickstart.base import BaseData, DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.errors import KickstartParseError, KickstartParseWarning
from pykickstart.options import KSOptionParser
op = F8_Device._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(F24)
return op
+
+class F34_Device(RemovedCommand, F24_Device):
+ def _getParser(self):
+ op = F24_Device._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F34)
+ return op
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import FC3, F29, versionToLongString
-from pykickstart.base import KickstartCommand, DeprecatedCommand
+from pykickstart.version import FC3, F29, F34, versionToLongString
+from pykickstart.base import KickstartCommand, DeprecatedCommand, RemovedCommand
from pykickstart.options import KSOptionParser
op = FC3_DeviceProbe._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(F29)
return op
+
+class F34_DeviceProbe(RemovedCommand, F29_DeviceProbe):
+ def _getParser(self):
+ op = F29_DeviceProbe._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F34)
+ return op
# with the express permission of Red Hat, Inc.
#
from pykickstart.errors import KickstartParseWarning
-from pykickstart.version import versionToLongString, FC6, F24
-from pykickstart.base import BaseData, DeprecatedCommand, KickstartCommand
+from pykickstart.version import versionToLongString, FC6, F24, F34
+from pykickstart.base import BaseData, DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.options import KSOptionParser
import warnings
op = FC6_DmRaid._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(F24)
return op
+
+class F34_DmRaid(RemovedCommand, F24_DmRaid):
+ def _getParser(self):
+ op = F24_DmRaid._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F34)
+ return op
class RHEL8_FcoeData(F28_FcoeData):
pass
+class RHEL9_FcoeData(F28_FcoeData):
+ pass
+
class F12_Fcoe(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
class RHEL8_Fcoe(F28_Fcoe):
pass
+
+class RHEL9_Fcoe(F28_Fcoe):
+ pass
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import FC3, F8, RHEL6, F29
+from pykickstart.version import FC3, F8, RHEL6, F25, F29, F34
from pykickstart.base import KickstartCommand
from pykickstart.errors import KickstartParseError
from pykickstart.i18n import _
class F14_IgnoreDisk(RHEL6_IgnoreDisk):
pass
-class F29_IgnoreDisk(F14_IgnoreDisk):
+class F25_IgnoreDisk(F14_IgnoreDisk):
removedKeywords = F14_IgnoreDisk.removedKeywords
removedAttrs = F14_IgnoreDisk.removedAttrs
+ def _getParser(self):
+ op = F14_IgnoreDisk._getParser(self)
+ op.add_argument("--drives", dest="ignoredisk", version=F25,
+ type=commaSplit, help="""
+ The following ignores the partitions on the first
+ two drives on the system:
+
+ ``ignoredisk --drives=sda,sdb``
+
+ or ignores as many drives as it could and skip the missing
+ (at least one must be matched):
+
+ ``ignoredisk --drives=sda|sdb1``
+
+ or ignores all virtio drives and only first scsi device if
+ exists
+
+ ``ignoredisk --drives=sda|vd*``""")
+ op.add_argument("--only-use", dest="onlyuse",
+ type=commaSplit, version=F25, help="""
+ The following ignores the partitions on the first
+ two drives on the system:
+
+ ``ignoredisk --only-use=sda,sdb``
+
+ or ignores as many drives as it could and skip the missing
+ (at least one must be matched):
+
+ ``ignoredisk --only-use=sda|sdb1``
+
+ or ignores all virtio drives and only first scsi device if
+ exists
+
+ ``ignoredisk --only-use=sda|vd*``""")
+ return op
+
+
+class F29_IgnoreDisk(F25_IgnoreDisk):
+ removedKeywords = F25_IgnoreDisk.removedKeywords
+ removedAttrs = F25_IgnoreDisk.removedAttrs
+
def parse(self, args):
return F8_IgnoreDisk.parse(self, args)
def _getParser(self):
- op = F14_IgnoreDisk._getParser(self)
+ op = F25_IgnoreDisk._getParser(self)
op.add_argument("--interactive", action="store_true",
default=False, deprecated=F29, help="""
Allow the user manually navigate the advanced storage
screen.""")
return op
+
+class F34_IgnoreDisk(F29_IgnoreDisk):
+ removedKeywords = F29_IgnoreDisk.removedKeywords
+ removedAttrs = F29_IgnoreDisk.removedAttrs
+
+ def _getParser(self):
+ op = F29_IgnoreDisk._getParser(self)
+ op.remove_argument("--interactive", version=F34)
+ return op
# 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 DeprecatedCommand
-from pykickstart.version import F20, F29, versionToLongString
+from pykickstart.base import DeprecatedCommand, RemovedCommand
+from pykickstart.version import F20, F29, F34, versionToLongString
from pykickstart.commands.upgrade import F11_Upgrade
op = F20_Install._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(F29)
return op
+
+
+class F34_Install(RemovedCommand, F29_Install):
+ def _getParser(self):
+ op = F29_Install._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F34)
+ return op
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import versionToLongString, FC3, F14
-from pykickstart.base import DeprecatedCommand, KickstartCommand
+from pykickstart.version import versionToLongString, FC3, F14, F15
+from pykickstart.base import DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.options import KSOptionParser
class FC3_Interactive(KickstartCommand):
op = FC3_Interactive._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(F14)
return op
+
+class F15_Interactive(RemovedCommand, F14_Interactive):
+ def _getParser(self):
+ op = F14_Interactive._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F15)
+ return op
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import FC3, FC5, versionToLongString
-from pykickstart.base import DeprecatedCommand, KickstartCommand
+from pykickstart.version import FC3, FC5, F7, versionToLongString
+from pykickstart.base import DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.errors import KickstartParseError
from pykickstart.i18n import _
from pykickstart.options import KSOptionParser
op = FC3_LangSupport._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC5)
return op
+
+class F7_LangSupport(RemovedCommand, FC5_LangSupport):
+ def _getParser(self):
+ op = FC5_LangSupport._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F7)
+ return op
# with the express permission of Red Hat, Inc.
#
from pykickstart.version import FC3, FC4, versionToLongString
-from pykickstart.base import KickstartCommand
+from pykickstart.base import KickstartCommand, RemovedCommand
from pykickstart.options import KSOptionParser
class FC3_LiloCheck(KickstartCommand):
def _getParser(self):
op = KSOptionParser(prog="lilocheck", description="check LILO boot loader", version=FC3)
- op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC4)
return op
def parse(self, args):
self.op.parse_args(args=args, lineno=self.lineno)
self.check = True
return self
+
+class FC4_LiloCheck(RemovedCommand, FC3_LiloCheck):
+ def _getParser(self):
+ op = FC3_LiloCheck._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(FC4)
+ return op
Btrfs support was removed.""" % versionToLongString(RHEL8)
return op
+
+class RHEL9_LogVol(RHEL8_LogVol):
+ pass
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import FC3
-from pykickstart.base import KickstartCommand
+from pykickstart.version import FC3, F34, versionToLongString
+from pykickstart.base import KickstartCommand, DeprecatedCommand
from pykickstart.options import KSOptionParser
class FC3_Method(KickstartCommand):
class F28_Method(RHEL7_Method):
pass
+
+class F34_Method(DeprecatedCommand, F19_Method):
+ def __init__(self): # pylint: disable=super-init-not-called
+ DeprecatedCommand.__init__(self)
+
+ def _getParser(self):
+ op = F19_Method._getParser(self)
+ op.description += "\n\n.. deprecated:: %s" % versionToLongString(F34)
+ return op
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import FC3, FC6, F10, versionToLongString
-from pykickstart.base import DeprecatedCommand, KickstartCommand
+from pykickstart.version import FC3, FC6, F10, F18, versionToLongString
+from pykickstart.base import DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.options import KSOptionParser
class FC3_Monitor(KickstartCommand):
op = FC6_Monitor._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(F10)
return op
+
+class F18_Monitor(RemovedCommand, F10_Monitor):
+ def _getParser(self):
+ op = F10_Monitor._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F18)
+ return op
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import versionToLongString, RHEL3, FC3
-from pykickstart.base import DeprecatedCommand, KickstartCommand
+from pykickstart.version import versionToLongString, RHEL3, FC3, F7
+from pykickstart.base import DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.errors import KickstartParseError
from pykickstart.options import KSOptionParser
op = RHEL3_Mouse._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC3)
return op
+
+class F7_Mouse(RemovedCommand, FC3_Mouse):
+ def _getParser(self):
+ op = FC3_Mouse._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F7)
+ return op
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import versionToLongString, FC6, F24
-from pykickstart.base import BaseData, DeprecatedCommand, KickstartCommand
+from pykickstart.version import versionToLongString, FC6, F24, F34
+from pykickstart.base import BaseData, DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.errors import KickstartParseError
from pykickstart.options import KSOptionParser
op = FC6_MultiPath._getParser(self)
op.description += "\n\n.. deprecated:: %s" % versionToLongString(F24)
return op
+
+class F34_MultiPath(RemovedCommand, F24_MultiPath):
+ def _getParser(self):
+ op = F24_MultiPath._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F34)
+ return op
class RHEL8_OSTreeSetup(F21_OSTreeSetup):
pass
+
+class RHEL9_OSTreeSetup(F21_OSTreeSetup):
+ pass
# with the express permission of Red Hat, Inc.
#
from pykickstart.version import RHEL5, RHEL6, RHEL8, versionToLongString
-from pykickstart.version import FC3, FC4, F9, F11, F12, F14, F17, F18, F23, F29
+from pykickstart.version import FC3, FC4, F9, F11, F12, F14, F17, F18, F23, F29, F34
from pykickstart.base import BaseData, KickstartCommand
from pykickstart.errors import KickstartParseError, KickstartParseWarning
from pykickstart.options import KSOptionParser, mountpoint
Btrfs support was removed.""" % versionToLongString(RHEL8)
return op
+
+class F34_Partition(F29_Partition):
+ removedKeywords = F29_Partition.removedKeywords
+ removedAttrs = F29_Partition.removedAttrs
+
+ def _getParser(self):
+ op = F29_Partition._getParser(self)
+ op.remove_argument("--active", version=F34)
+ return op
+
+
+class RHEL9_Partition(F34_Partition):
+ removedKeywords = F34_Partition.removedKeywords
+ removedAttrs = F34_Partition.removedAttrs
+
+ def parse(self, args):
+ retval = F34_Partition.parse(self, args)
+ if retval.mountpoint.startswith("btrfs.") or retval.fstype == "btrfs":
+ raise KickstartParseError(_("Btrfs file system is not supported"), lineno=self.lineno)
+ return retval
+
+ def _getParser(self):
+ "Only necessary for the type change documentation"
+ op = F34_Partition._getParser(self)
+ for action in op._actions:
+ if "--fstype" in action.option_strings:
+ action.help += """
+
+ .. versionchanged:: %s
+
+ Btrfs support was removed.""" % versionToLongString(RHEL8)
+ return op
Btrfs support was removed.""" % versionToLongString(RHEL8)
return op
+
+class RHEL9_Raid(RHEL8_Raid):
+ pass
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import FC3, F8
+from pykickstart.version import FC3, F8, F37
from pykickstart.base import KickstartCommand
from pykickstart.errors import KickstartParseError
from pykickstart.options import KSOptionParser
from pykickstart.i18n import _
-import six
class FC3_RootPw(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
retval = KickstartCommand.__str__(self)
if self.password:
- if isinstance(self.password, six.binary_type) and b'#' in self.password:
- password = '\"' + self.password + '\"'
- elif not isinstance(self.password, six.binary_type) and u'#' in self.password:
+ if '#' in self.password:
password = '\"' + self.password + '\"'
else:
password = self.password
self.set_to_self(ns)
return self
+
+class F37_RootPw(F18_RootPw):
+ removedKeywords = F18_RootPw.removedKeywords
+ removedAttrs = F18_RootPw.removedAttrs
+
+ def __init__(self, writePriority=0, *args, **kwargs):
+ F18_RootPw.__init__(self, writePriority, *args, **kwargs)
+ self.allow_ssh = kwargs.get("allow_ssh", False)
+
+ def _getArgsAsStr(self):
+ retval = F18_RootPw._getArgsAsStr(self)
+
+ if self.allow_ssh:
+ retval += " --allow-ssh"
+
+ return retval
+
+ def _getParser(self):
+ op = F18_RootPw._getParser(self)
+ op.add_argument("--allow-ssh", action="store_true", default=False,
+ version=F37, help="""
+ This will allow remote root logins via ssh using only
+ the password. Only use as a last resort.""")
+ return op
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.version import F7
+from textwrap import dedent
+
+from pykickstart.version import F7, F34, versionToLongString
from pykickstart.base import KickstartCommand
from pykickstart.errors import KickstartParseError
from pykickstart.options import KSOptionParser
self.url = _ns.updates[0]
return self
+
+
+class F34_Updates(F7_Updates):
+ removedKeywords = F7_Updates.removedKeywords
+ removedAttrs = F7_Updates.removedAttrs
+
+ def __str__(self):
+ retval = KickstartCommand.__str__(self)
+
+ if self.url:
+ retval += "updates %s\n" % self.url
+
+ return retval
+
+ def _getParser(self):
+ op = KSOptionParser(
+ prog="updates", version=F7, description="""
+ Specify the location of an updates.img for use in installation.
+ """
+ )
+ url_action = op.add_argument(
+ "url", metavar="[URL]", version=F7, help="""
+ If present, the URL for an updates image.
+
+ If not present, anaconda will attempt to load from a floppy disk.
+ """
+ )
+ url_action.help += dedent(
+ """
+
+ .. versionchanged:: %s
+
+ The URL for an updates image is required. Anaconda no longer supports
+ updates on a floppy disk.
+ """ % versionToLongString(F34)
+ )
+ return op
+
+ def parse(self, args):
+ ns = self.op.parse_args(args=args, lineno=self.lineno)
+ self.set_to_self(ns)
+ return self
# with the express permission of Red Hat, Inc.
#
from textwrap import dedent
-from pykickstart.version import versionToLongString, FC3, F11, F20
-from pykickstart.base import DeprecatedCommand, KickstartCommand
+from pykickstart.version import versionToLongString, FC3, F11, F20, F29
+from pykickstart.base import DeprecatedCommand, KickstartCommand, RemovedCommand
from pykickstart.errors import KickstartParseError
from pykickstart.options import KSOptionParser
recommended instead. Therefore, the upgrade command
essentially does nothing.""" % versionToLongString(F20))
return op
+
+class F29_Upgrade(RemovedCommand, F20_Upgrade):
+ def _getParser(self):
+ op = F20_Upgrade._getParser(self)
+ op.description += "\n\n.. versionremoved:: %s" % versionToLongString(F29)
+ return op
from pykickstart.options import KSOptionParser, commaSplit
import warnings
-import six
from pykickstart.i18n import _
class FC6_UserData(BaseData):
if self.name:
retval += " --name=%s" % self.name
if self.password:
- if isinstance(self.password, six.binary_type) and b'#' in self.password:
- retval += " --password=\"%s\"" % self.password
- elif not isinstance(self.password, six.binary_type) and u'#' in self.password:
+ if '#' in self.password:
retval += " --password=\"%s\"" % self.password
else:
retval += " --password=%s" % self.password
class RHEL8_VolGroupData(F21_VolGroupData):
pass
+class RHEL9_VolGroupData(F21_VolGroupData):
+ pass
+
class FC3_VolGroup(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
class RHEL8_VolGroup(F21_VolGroup):
pass
+
+class RHEL9_VolGroup(F21_VolGroup):
+ pass
# subject to the GNU General Public License and may only be used or replicated
# with the express permission of Red Hat, Inc.
#
-from pykickstart.errors import KickstartParseWarning
-from pykickstart.version import FC3, F12, F14
+from textwrap import dedent
+
+from pykickstart.errors import KickstartParseWarning, KickstartParseError
+from pykickstart.version import FC3, F12, F14, F37, versionToLongString
from pykickstart.base import BaseData, KickstartCommand
from pykickstart.options import KSOptionParser
class F14_ZFCPData(F12_ZFCPData):
pass
+class F37_ZFCPData(F14_ZFCPData):
+ pass
+
class FC3_ZFCP(KickstartCommand):
removedKeywords = KickstartCommand.removedKeywords
removedAttrs = KickstartCommand.removedAttrs
return retval
def _getParser(self):
- op = KSOptionParser(prog="zfcp", description="define a zFCP storage device (IBM System z only)", version=FC3)
- op.add_argument("--devnum", required=True, version=FC3, help="zFCP device number")
- op.add_argument("--fcplun", required=True, version=FC3, help="zFCP LUN")
+ op = KSOptionParser(prog="zfcp", version=FC3, description="""
+ Define a Fibre channel device. This option only applies
+ on IBM System z.""")
+ op.add_argument("--devnum", required=True, version=FC3, help="""
+ The device number (zFCP adaptor device bus ID).""")
+ op.add_argument("--fcplun", required=True, version=FC3, help="""
+ The device's Logical Unit Number (LUN). Takes the form
+ of a 16-digit number, preceded by 0x.""")
+ op.add_argument("--wwpn", required=True, version=FC3, help="""
+ The device's World Wide Port Name (WWPN). Takes the form
+ of a 16-digit number, preceded by 0x.""")
op.add_argument("--scsiid", required=True, version=FC3, help="SCSI ID")
op.add_argument("--scsilun", required=True, version=FC3, help="SCSI LUN")
- op.add_argument("--wwpn", required=True, version=FC3, help="World Wide Port Name")
return op
def parse(self, args):
op.remove_argument("--scsiid", version=F14)
op.remove_argument("--scsilun", version=F14)
return op
+
+class F37_ZFCP(F14_ZFCP):
+ removedKeywords = F14_ZFCP.removedKeywords
+ removedAttrs = F14_ZFCP.removedAttrs
+
+ def _getParser(self):
+ op = F14_ZFCP._getParser(self)
+ op.description += dedent("""
+
+ .. versionchanged:: %s
+
+ It is sufficient to specify an FCP device bus ID if automatic LUN scanning
+ is available. Otherwise all three parameters are required.
+
+ ``zfcp --devnum=<devnum> [--wwpn=<wwpn> --fcplun=<lun>]``
+
+ Automatic LUN scanning is available for FCP devices operating in NPIV mode
+ if it is not disabled through the `zfcp.allow_lun_scan` module parameter
+ (enabled by default). It provides access to all SCSI devices, that is, WWPNs
+ and FCP LUNs, found in the storage area network attached to the FCP device
+ with the specified bus ID.
+
+ """ % versionToLongString(F37))
+
+ op.epilog += dedent("""
+ For example::
+
+ zfcp --devnum=0.0.6000
+ zfcp --devnum=0.0.4000 --wwpn=0x5005076300C213e9 --fcplun=0x5022000000000000
+
+ """)
+
+ op.add_argument("--wwpn", default="", required=False, version=F37, help="""
+ The argument is optional.""")
+ op.add_argument("--fcplun", default="", required=False, version=F37, help="""
+ The argument is optional.""")
+ return op
+
+ def parse(self, args):
+ data = F14_ZFCP.parse(self, args)
+
+ if not ((data.devnum and not data.wwpn and not data.fcplun)
+ or (data.devnum and data.wwpn and data.fcplun)):
+ msg = _("Only --devnum or --devnum with --wwpn and --fcplun are allowed.")
+ raise KickstartParseError(msg, lineno=self.lineno)
+
+ return data
"harddrive": commands.harddrive.FC3_HardDrive,
"ignoredisk": commands.ignoredisk.F14_IgnoreDisk,
"install": commands.upgrade.F11_Upgrade,
+ "interactive": commands.interactive.F15_Interactive, # RemovedCommand
"iscsi": commands.iscsi.F10_Iscsi,
"iscsiname": commands.iscsiname.FC6_IscsiName,
"keyboard": commands.keyboard.FC3_Keyboard,
"logvol": commands.logvol.F18_LogVol,
"mediacheck": commands.mediacheck.FC4_MediaCheck,
"method": commands.method.F18_Method,
+ "monitor": commands.monitor.F18_Monitor, # RemovedCommand
"multipath": commands.multipath.FC6_MultiPath,
"network": commands.network.F18_Network,
"nfs": commands.nfs.FC6_NFS,
"bootloader": commands.bootloader.F21_Bootloader,
"btrfs": commands.btrfs.F23_BTRFS,
"cdrom": commands.cdrom.FC3_Cdrom,
- "clearpart": commands.clearpart.F21_ClearPart,
+ "clearpart": commands.clearpart.F25_ClearPart,
"cmdline": commands.displaymode.FC3_DisplayMode,
"device": commands.device.F24_Device,
"deviceprobe": commands.deviceprobe.FC3_DeviceProbe,
"group": commands.group.F12_Group,
"halt": commands.reboot.F23_Reboot,
"harddrive": commands.harddrive.FC3_HardDrive,
- "ignoredisk": commands.ignoredisk.F14_IgnoreDisk,
+ "ignoredisk": commands.ignoredisk.F25_IgnoreDisk,
"install": commands.install.F20_Install,
"iscsi": commands.iscsi.F17_Iscsi,
"iscsiname": commands.iscsiname.FC6_IscsiName,
"bootloader": commands.bootloader.F21_Bootloader,
"btrfs": commands.btrfs.F23_BTRFS,
"cdrom": commands.cdrom.FC3_Cdrom,
- "clearpart": commands.clearpart.F21_ClearPart,
+ "clearpart": commands.clearpart.F25_ClearPart,
"cmdline": commands.displaymode.F26_DisplayMode,
"device": commands.device.F24_Device,
"deviceprobe": commands.deviceprobe.FC3_DeviceProbe,
"group": commands.group.F12_Group,
"halt": commands.reboot.F23_Reboot,
"harddrive": commands.harddrive.FC3_HardDrive,
- "ignoredisk": commands.ignoredisk.F14_IgnoreDisk,
+ "ignoredisk": commands.ignoredisk.F25_IgnoreDisk,
"install": commands.install.F20_Install,
"iscsi": commands.iscsi.F17_Iscsi,
"iscsiname": commands.iscsiname.FC6_IscsiName,
"bootloader": commands.bootloader.F21_Bootloader,
"btrfs": commands.btrfs.F23_BTRFS,
"cdrom": commands.cdrom.FC3_Cdrom,
- "clearpart": commands.clearpart.F21_ClearPart,
+ "clearpart": commands.clearpart.F25_ClearPart,
"cmdline": commands.displaymode.F26_DisplayMode,
"device": commands.device.F24_Device,
"deviceprobe": commands.deviceprobe.FC3_DeviceProbe,
"group": commands.group.F12_Group,
"halt": commands.reboot.F23_Reboot,
"harddrive": commands.harddrive.FC3_HardDrive,
- "ignoredisk": commands.ignoredisk.F14_IgnoreDisk,
+ "ignoredisk": commands.ignoredisk.F25_IgnoreDisk,
"install": commands.install.F20_Install,
"iscsi": commands.iscsi.F17_Iscsi,
"iscsiname": commands.iscsiname.FC6_IscsiName,
"halt": commands.reboot.F23_Reboot,
"harddrive": commands.harddrive.FC3_HardDrive,
"hmc" : commands.hmc.F28_Hmc,
- "ignoredisk": commands.ignoredisk.F14_IgnoreDisk,
+ "ignoredisk": commands.ignoredisk.F25_IgnoreDisk,
"install": commands.install.F20_Install,
"iscsi": commands.iscsi.F17_Iscsi,
"iscsiname": commands.iscsiname.FC6_IscsiName,
"text": commands.displaymode.F26_DisplayMode,
"timezone": commands.timezone.F25_Timezone,
"updates": commands.updates.F7_Updates,
+ "upgrade": commands.upgrade.F29_Upgrade, # RemovedCommand
"url": commands.url.F27_Url,
"user": commands.user.F24_User,
"vnc": commands.vnc.F9_Vnc,
"authselect": commands.authselect.F28_Authselect,
"autopart": commands.autopart.F29_AutoPart,
"autostep": commands.autostep.F34_AutoStep,
- "bootloader": commands.bootloader.F29_Bootloader,
+ "bootloader": commands.bootloader.F34_Bootloader,
"btrfs": commands.btrfs.F23_BTRFS,
"cdrom": commands.cdrom.FC3_Cdrom,
"clearpart": commands.clearpart.F28_ClearPart,
"cmdline": commands.displaymode.F26_DisplayMode,
- "device": commands.device.F24_Device,
- "deviceprobe": commands.deviceprobe.F29_DeviceProbe,
- "dmraid": commands.dmraid.F24_DmRaid,
+ "device": commands.device.F34_Device,
+ "deviceprobe": commands.deviceprobe.F34_DeviceProbe,
+ "dmraid": commands.dmraid.F34_DmRaid,
"driverdisk": commands.driverdisk.F14_DriverDisk,
"module": commands.module.F31_Module,
"eula": commands.eula.F20_Eula,
"halt": commands.reboot.F23_Reboot,
"harddrive": commands.harddrive.F33_HardDrive,
"hmc": commands.hmc.F28_Hmc,
- "ignoredisk": commands.ignoredisk.F29_IgnoreDisk,
- "install": commands.install.F29_Install,
+ "ignoredisk": commands.ignoredisk.F34_IgnoreDisk,
+ "install": commands.install.F34_Install,
"iscsi": commands.iscsi.F17_Iscsi,
"iscsiname": commands.iscsiname.FC6_IscsiName,
"keyboard": commands.keyboard.F18_Keyboard,
"logging": commands.logging.F34_Logging,
"logvol": commands.logvol.F29_LogVol,
"mediacheck": commands.mediacheck.FC4_MediaCheck,
- "method": commands.method.F28_Method,
+ "method": commands.method.F34_Method,
"mount": commands.mount.F27_Mount,
- "multipath": commands.multipath.F24_MultiPath,
+ "multipath": commands.multipath.F34_MultiPath,
"network": commands.network.F27_Network,
"nfs": commands.nfs.FC6_NFS,
"nvdimm": commands.nvdimm.F28_Nvdimm,
"timesource": commands.timesource.F33_Timesource,
"ostreesetup": commands.ostreesetup.F21_OSTreeSetup,
- "part": commands.partition.F29_Partition,
- "partition": commands.partition.F29_Partition,
+ "part": commands.partition.F34_Partition,
+ "partition": commands.partition.F34_Partition,
"poweroff": commands.reboot.F23_Reboot,
"raid": commands.raid.F29_Raid,
"realm": commands.realm.F19_Realm,
"sshkey": commands.sshkey.F22_SshKey,
"text": commands.displaymode.F26_DisplayMode,
"timezone": commands.timezone.F33_Timezone,
- "updates": commands.updates.F7_Updates,
+ "updates": commands.updates.F34_Updates,
"url": commands.url.F30_Url,
"user": commands.user.F24_User,
"vnc": commands.vnc.F9_Vnc,
--- /dev/null
+#
+# Copyright 2021 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.
+#
+__all__ = ["F35Handler"]
+
+from pykickstart import commands
+from pykickstart.base import BaseHandler
+from pykickstart.version import F35
+
+class F35Handler(BaseHandler):
+ version = F35
+
+ commandMap = {
+ "auth": commands.authconfig.F35_Authconfig, # RemovedCommand
+ "authconfig": commands.authconfig.F35_Authconfig, # RemovedCommand
+ "authselect": commands.authselect.F28_Authselect,
+ "autopart": commands.autopart.F29_AutoPart,
+ "autostep": commands.autostep.F34_AutoStep,
+ "bootloader": commands.bootloader.F34_Bootloader,
+ "btrfs": commands.btrfs.F23_BTRFS,
+ "cdrom": commands.cdrom.FC3_Cdrom,
+ "clearpart": commands.clearpart.F28_ClearPart,
+ "cmdline": commands.displaymode.F26_DisplayMode,
+ "device": commands.device.F34_Device,
+ "deviceprobe": commands.deviceprobe.F34_DeviceProbe,
+ "dmraid": commands.dmraid.F34_DmRaid,
+ "driverdisk": commands.driverdisk.F14_DriverDisk,
+ "module": commands.module.F31_Module,
+ "eula": commands.eula.F20_Eula,
+ "fcoe": commands.fcoe.F28_Fcoe,
+ "firewall": commands.firewall.F28_Firewall,
+ "firstboot": commands.firstboot.FC3_Firstboot,
+ "graphical": commands.displaymode.F26_DisplayMode,
+ "group": commands.group.F12_Group,
+ "halt": commands.reboot.F23_Reboot,
+ "harddrive": commands.harddrive.F33_HardDrive,
+ "hmc": commands.hmc.F28_Hmc,
+ "ignoredisk": commands.ignoredisk.F34_IgnoreDisk,
+ "install": commands.install.F34_Install,
+ "iscsi": commands.iscsi.F17_Iscsi,
+ "iscsiname": commands.iscsiname.FC6_IscsiName,
+ "keyboard": commands.keyboard.F18_Keyboard,
+ "lang": commands.lang.F19_Lang,
+ "liveimg": commands.liveimg.F19_Liveimg,
+ "logging": commands.logging.F34_Logging,
+ "logvol": commands.logvol.F29_LogVol,
+ "mediacheck": commands.mediacheck.FC4_MediaCheck,
+ "method": commands.method.F34_Method,
+ "mount": commands.mount.F27_Mount,
+ "multipath": commands.multipath.F34_MultiPath,
+ "network": commands.network.F27_Network,
+ "nfs": commands.nfs.FC6_NFS,
+ "nvdimm": commands.nvdimm.F28_Nvdimm,
+ "timesource": commands.timesource.F33_Timesource,
+ "ostreesetup": commands.ostreesetup.F21_OSTreeSetup,
+ "part": commands.partition.F34_Partition,
+ "partition": commands.partition.F34_Partition,
+ "poweroff": commands.reboot.F23_Reboot,
+ "raid": commands.raid.F29_Raid,
+ "realm": commands.realm.F19_Realm,
+ "reboot": commands.reboot.F23_Reboot,
+ "repo": commands.repo.F33_Repo,
+ "reqpart": commands.reqpart.F23_ReqPart,
+ "rescue": commands.rescue.F10_Rescue,
+ "rootpw": commands.rootpw.F18_RootPw,
+ "selinux": commands.selinux.FC3_SELinux,
+ "services": commands.services.FC6_Services,
+ "shutdown": commands.reboot.F23_Reboot,
+ "skipx": commands.skipx.FC3_SkipX,
+ "snapshot": commands.snapshot.F26_Snapshot,
+ "sshpw": commands.sshpw.F24_SshPw,
+ "sshkey": commands.sshkey.F22_SshKey,
+ "text": commands.displaymode.F26_DisplayMode,
+ "timezone": commands.timezone.F33_Timezone,
+ "updates": commands.updates.F34_Updates,
+ "url": commands.url.F30_Url,
+ "user": commands.user.F24_User,
+ "vnc": commands.vnc.F9_Vnc,
+ "volgroup": commands.volgroup.F21_VolGroup,
+ "xconfig": commands.xconfig.F14_XConfig,
+ "zerombr": commands.zerombr.F9_ZeroMbr,
+ "zfcp": commands.zfcp.F14_ZFCP,
+ "zipl": commands.zipl.F32_Zipl,
+ }
+
+ dataMap = {
+ "BTRFSData": commands.btrfs.F23_BTRFSData,
+ "DriverDiskData": commands.driverdisk.F14_DriverDiskData,
+ "DeviceData": commands.device.F8_DeviceData,
+ "DmRaidData": commands.dmraid.FC6_DmRaidData,
+ "ModuleData": commands.module.F31_ModuleData,
+ "TimesourceData": commands.timesource.F33_TimesourceData,
+ "FcoeData": commands.fcoe.F28_FcoeData,
+ "GroupData": commands.group.F12_GroupData,
+ "IscsiData": commands.iscsi.F17_IscsiData,
+ "LogVolData": commands.logvol.F29_LogVolData,
+ "MountData": commands.mount.F27_MountData,
+ "MultiPathData": commands.multipath.FC6_MultiPathData,
+ "NetworkData": commands.network.F27_NetworkData,
+ "NvdimmData": commands.nvdimm.F28_NvdimmData,
+ "PartData": commands.partition.F29_PartData,
+ "RaidData": commands.raid.F29_RaidData,
+ "RepoData": commands.repo.F30_RepoData,
+ "SnapshotData": commands.snapshot.F26_SnapshotData,
+ "SshPwData": commands.sshpw.F24_SshPwData,
+ "SshKeyData": commands.sshkey.F22_SshKeyData,
+ "UserData": commands.user.F19_UserData,
+ "VolGroupData": commands.volgroup.F21_VolGroupData,
+ "ZFCPData": commands.zfcp.F14_ZFCPData,
+ }
--- /dev/null
+#
+# Copyright 2021 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.
+#
+__all__ = ["F36Handler"]
+
+from pykickstart import commands
+from pykickstart.base import BaseHandler
+from pykickstart.version import F36
+
+class F36Handler(BaseHandler):
+ version = F36
+
+ commandMap = {
+ "auth": commands.authconfig.F35_Authconfig, # RemovedCommand
+ "authconfig": commands.authconfig.F35_Authconfig, # RemovedCommand
+ "authselect": commands.authselect.F28_Authselect,
+ "autopart": commands.autopart.F29_AutoPart,
+ "autostep": commands.autostep.F34_AutoStep,
+ "bootloader": commands.bootloader.F34_Bootloader,
+ "btrfs": commands.btrfs.F23_BTRFS,
+ "cdrom": commands.cdrom.FC3_Cdrom,
+ "clearpart": commands.clearpart.F28_ClearPart,
+ "cmdline": commands.displaymode.F26_DisplayMode,
+ "device": commands.device.F34_Device,
+ "deviceprobe": commands.deviceprobe.F34_DeviceProbe,
+ "dmraid": commands.dmraid.F34_DmRaid,
+ "driverdisk": commands.driverdisk.F14_DriverDisk,
+ "module": commands.module.F31_Module,
+ "eula": commands.eula.F20_Eula,
+ "fcoe": commands.fcoe.F28_Fcoe,
+ "firewall": commands.firewall.F28_Firewall,
+ "firstboot": commands.firstboot.FC3_Firstboot,
+ "graphical": commands.displaymode.F26_DisplayMode,
+ "group": commands.group.F12_Group,
+ "halt": commands.reboot.F23_Reboot,
+ "harddrive": commands.harddrive.F33_HardDrive,
+ "hmc": commands.hmc.F28_Hmc,
+ "ignoredisk": commands.ignoredisk.F34_IgnoreDisk,
+ "install": commands.install.F34_Install,
+ "iscsi": commands.iscsi.F17_Iscsi,
+ "iscsiname": commands.iscsiname.FC6_IscsiName,
+ "keyboard": commands.keyboard.F18_Keyboard,
+ "lang": commands.lang.F19_Lang,
+ "liveimg": commands.liveimg.F19_Liveimg,
+ "logging": commands.logging.F34_Logging,
+ "logvol": commands.logvol.F29_LogVol,
+ "mediacheck": commands.mediacheck.FC4_MediaCheck,
+ "method": commands.method.F34_Method,
+ "mount": commands.mount.F27_Mount,
+ "multipath": commands.multipath.F34_MultiPath,
+ "network": commands.network.F27_Network,
+ "nfs": commands.nfs.FC6_NFS,
+ "nvdimm": commands.nvdimm.F28_Nvdimm,
+ "timesource": commands.timesource.F33_Timesource,
+ "ostreesetup": commands.ostreesetup.F21_OSTreeSetup,
+ "part": commands.partition.F34_Partition,
+ "partition": commands.partition.F34_Partition,
+ "poweroff": commands.reboot.F23_Reboot,
+ "raid": commands.raid.F29_Raid,
+ "realm": commands.realm.F19_Realm,
+ "reboot": commands.reboot.F23_Reboot,
+ "repo": commands.repo.F33_Repo,
+ "reqpart": commands.reqpart.F23_ReqPart,
+ "rescue": commands.rescue.F10_Rescue,
+ "rootpw": commands.rootpw.F18_RootPw,
+ "selinux": commands.selinux.FC3_SELinux,
+ "services": commands.services.FC6_Services,
+ "shutdown": commands.reboot.F23_Reboot,
+ "skipx": commands.skipx.FC3_SkipX,
+ "snapshot": commands.snapshot.F26_Snapshot,
+ "sshpw": commands.sshpw.F24_SshPw,
+ "sshkey": commands.sshkey.F22_SshKey,
+ "text": commands.displaymode.F26_DisplayMode,
+ "timezone": commands.timezone.F33_Timezone,
+ "updates": commands.updates.F34_Updates,
+ "url": commands.url.F30_Url,
+ "user": commands.user.F24_User,
+ "vnc": commands.vnc.F9_Vnc,
+ "volgroup": commands.volgroup.F21_VolGroup,
+ "xconfig": commands.xconfig.F14_XConfig,
+ "zerombr": commands.zerombr.F9_ZeroMbr,
+ "zfcp": commands.zfcp.F14_ZFCP,
+ "zipl": commands.zipl.F32_Zipl,
+ }
+
+ dataMap = {
+ "BTRFSData": commands.btrfs.F23_BTRFSData,
+ "DriverDiskData": commands.driverdisk.F14_DriverDiskData,
+ "DeviceData": commands.device.F8_DeviceData,
+ "DmRaidData": commands.dmraid.FC6_DmRaidData,
+ "ModuleData": commands.module.F31_ModuleData,
+ "TimesourceData": commands.timesource.F33_TimesourceData,
+ "FcoeData": commands.fcoe.F28_FcoeData,
+ "GroupData": commands.group.F12_GroupData,
+ "IscsiData": commands.iscsi.F17_IscsiData,
+ "LogVolData": commands.logvol.F29_LogVolData,
+ "MountData": commands.mount.F27_MountData,
+ "MultiPathData": commands.multipath.FC6_MultiPathData,
+ "NetworkData": commands.network.F27_NetworkData,
+ "NvdimmData": commands.nvdimm.F28_NvdimmData,
+ "PartData": commands.partition.F29_PartData,
+ "RaidData": commands.raid.F29_RaidData,
+ "RepoData": commands.repo.F30_RepoData,
+ "SnapshotData": commands.snapshot.F26_SnapshotData,
+ "SshPwData": commands.sshpw.F24_SshPwData,
+ "SshKeyData": commands.sshkey.F22_SshKeyData,
+ "UserData": commands.user.F19_UserData,
+ "VolGroupData": commands.volgroup.F21_VolGroupData,
+ "ZFCPData": commands.zfcp.F14_ZFCPData,
+ }
--- /dev/null
+#
+# Copyright 2021 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.
+#
+__all__ = ["F37Handler"]
+
+from pykickstart import commands
+from pykickstart.base import BaseHandler
+from pykickstart.version import F37
+
+class F37Handler(BaseHandler):
+ version = F37
+
+ commandMap = {
+ "auth": commands.authconfig.F35_Authconfig, # RemovedCommand
+ "authconfig": commands.authconfig.F35_Authconfig, # RemovedCommand
+ "authselect": commands.authselect.F28_Authselect,
+ "autopart": commands.autopart.F29_AutoPart,
+ "autostep": commands.autostep.F34_AutoStep,
+ "bootloader": commands.bootloader.F34_Bootloader,
+ "btrfs": commands.btrfs.F23_BTRFS,
+ "cdrom": commands.cdrom.FC3_Cdrom,
+ "clearpart": commands.clearpart.F28_ClearPart,
+ "cmdline": commands.displaymode.F26_DisplayMode,
+ "device": commands.device.F34_Device,
+ "deviceprobe": commands.deviceprobe.F34_DeviceProbe,
+ "dmraid": commands.dmraid.F34_DmRaid,
+ "driverdisk": commands.driverdisk.F14_DriverDisk,
+ "module": commands.module.F31_Module,
+ "eula": commands.eula.F20_Eula,
+ "fcoe": commands.fcoe.F28_Fcoe,
+ "firewall": commands.firewall.F28_Firewall,
+ "firstboot": commands.firstboot.FC3_Firstboot,
+ "graphical": commands.displaymode.F26_DisplayMode,
+ "group": commands.group.F12_Group,
+ "halt": commands.reboot.F23_Reboot,
+ "harddrive": commands.harddrive.F33_HardDrive,
+ "hmc": commands.hmc.F28_Hmc,
+ "ignoredisk": commands.ignoredisk.F34_IgnoreDisk,
+ "install": commands.install.F34_Install,
+ "iscsi": commands.iscsi.F17_Iscsi,
+ "iscsiname": commands.iscsiname.FC6_IscsiName,
+ "keyboard": commands.keyboard.F18_Keyboard,
+ "lang": commands.lang.F19_Lang,
+ "liveimg": commands.liveimg.F19_Liveimg,
+ "logging": commands.logging.F34_Logging,
+ "logvol": commands.logvol.F29_LogVol,
+ "mediacheck": commands.mediacheck.FC4_MediaCheck,
+ "method": commands.method.F34_Method,
+ "mount": commands.mount.F27_Mount,
+ "multipath": commands.multipath.F34_MultiPath,
+ "network": commands.network.F27_Network,
+ "nfs": commands.nfs.FC6_NFS,
+ "nvdimm": commands.nvdimm.F28_Nvdimm,
+ "timesource": commands.timesource.F33_Timesource,
+ "ostreesetup": commands.ostreesetup.F21_OSTreeSetup,
+ "part": commands.partition.F34_Partition,
+ "partition": commands.partition.F34_Partition,
+ "poweroff": commands.reboot.F23_Reboot,
+ "raid": commands.raid.F29_Raid,
+ "realm": commands.realm.F19_Realm,
+ "reboot": commands.reboot.F23_Reboot,
+ "repo": commands.repo.F33_Repo,
+ "reqpart": commands.reqpart.F23_ReqPart,
+ "rescue": commands.rescue.F10_Rescue,
+ "rootpw": commands.rootpw.F37_RootPw,
+ "selinux": commands.selinux.FC3_SELinux,
+ "services": commands.services.FC6_Services,
+ "shutdown": commands.reboot.F23_Reboot,
+ "skipx": commands.skipx.FC3_SkipX,
+ "snapshot": commands.snapshot.F26_Snapshot,
+ "sshpw": commands.sshpw.F24_SshPw,
+ "sshkey": commands.sshkey.F22_SshKey,
+ "text": commands.displaymode.F26_DisplayMode,
+ "timezone": commands.timezone.F33_Timezone,
+ "updates": commands.updates.F34_Updates,
+ "url": commands.url.F30_Url,
+ "user": commands.user.F24_User,
+ "vnc": commands.vnc.F9_Vnc,
+ "volgroup": commands.volgroup.F21_VolGroup,
+ "xconfig": commands.xconfig.F14_XConfig,
+ "zerombr": commands.zerombr.F9_ZeroMbr,
+ "zfcp": commands.zfcp.F37_ZFCP,
+ "zipl": commands.zipl.F32_Zipl,
+ }
+
+ dataMap = {
+ "BTRFSData": commands.btrfs.F23_BTRFSData,
+ "DriverDiskData": commands.driverdisk.F14_DriverDiskData,
+ "DeviceData": commands.device.F8_DeviceData,
+ "DmRaidData": commands.dmraid.FC6_DmRaidData,
+ "ModuleData": commands.module.F31_ModuleData,
+ "TimesourceData": commands.timesource.F33_TimesourceData,
+ "FcoeData": commands.fcoe.F28_FcoeData,
+ "GroupData": commands.group.F12_GroupData,
+ "IscsiData": commands.iscsi.F17_IscsiData,
+ "LogVolData": commands.logvol.F29_LogVolData,
+ "MountData": commands.mount.F27_MountData,
+ "MultiPathData": commands.multipath.FC6_MultiPathData,
+ "NetworkData": commands.network.F27_NetworkData,
+ "NvdimmData": commands.nvdimm.F28_NvdimmData,
+ "PartData": commands.partition.F29_PartData,
+ "RaidData": commands.raid.F29_RaidData,
+ "RepoData": commands.repo.F30_RepoData,
+ "SnapshotData": commands.snapshot.F26_SnapshotData,
+ "SshPwData": commands.sshpw.F24_SshPwData,
+ "SshKeyData": commands.sshkey.F22_SshKeyData,
+ "UserData": commands.user.F19_UserData,
+ "VolGroupData": commands.volgroup.F21_VolGroupData,
+ "ZFCPData": commands.zfcp.F37_ZFCPData,
+ }
"iscsiname": commands.iscsiname.FC6_IscsiName,
"keyboard": commands.keyboard.FC3_Keyboard,
"lang": commands.lang.FC3_Lang,
+ "langsupport": commands.langsupport.F7_LangSupport, # RemovedCommand
"logging": commands.logging.FC6_Logging,
"logvol": commands.logvol.FC4_LogVol,
"mediacheck": commands.mediacheck.FC4_MediaCheck,
"method": commands.method.FC6_Method,
"monitor": commands.monitor.FC6_Monitor,
+ "mouse": commands.mouse.F7_Mouse, # RemovedCommand
"multipath": commands.multipath.FC6_MultiPath,
"network": commands.network.FC6_Network,
"nfs": commands.nfs.FC6_NFS,
"keyboard": commands.keyboard.FC3_Keyboard,
"lang": commands.lang.FC3_Lang,
"langsupport": commands.langsupport.FC3_LangSupport,
+ "lilo": commands.bootloader.FC4_Lilo, # RemovedCommand
+ "lilocheck": commands.lilocheck.FC4_LiloCheck, # RemovedCommand
"logvol": commands.logvol.FC4_LogVol,
"mediacheck": commands.mediacheck.FC4_MediaCheck,
"method": commands.method.FC3_Method,
--- /dev/null
+#
+# Martin Kolman <mkolman@redhat.com>
+#
+# Copyright 2021 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.
+#
+__all__ = ["RHEL9Handler"]
+
+from pykickstart import commands
+from pykickstart.base import BaseHandler
+from pykickstart.version import RHEL9
+
+class RHEL9Handler(BaseHandler):
+ version = RHEL9
+
+ commandMap = {
+ "auth": commands.authconfig.F28_Authconfig,
+ "authconfig": commands.authconfig.F28_Authconfig,
+ "authselect": commands.authselect.F28_Authselect,
+ "autopart": commands.autopart.RHEL9_AutoPart,
+ "autostep": commands.autostep.F34_AutoStep,
+ "bootloader": commands.bootloader.RHEL9_Bootloader,
+ "btrfs": commands.btrfs.RHEL9_BTRFS,
+ "cdrom": commands.cdrom.FC3_Cdrom,
+ "clearpart": commands.clearpart.F28_ClearPart,
+ "cmdline": commands.displaymode.F26_DisplayMode,
+ "device": commands.device.F34_Device,
+ "deviceprobe": commands.deviceprobe.F34_DeviceProbe,
+ "dmraid": commands.dmraid.F34_DmRaid,
+ "driverdisk": commands.driverdisk.F14_DriverDisk,
+ "module": commands.module.F31_Module,
+ "eula": commands.eula.F20_Eula,
+ "fcoe": commands.fcoe.RHEL9_Fcoe,
+ "firewall": commands.firewall.F28_Firewall,
+ "firstboot": commands.firstboot.FC3_Firstboot,
+ "graphical": commands.displaymode.F26_DisplayMode,
+ "group": commands.group.F12_Group,
+ "halt": commands.reboot.F23_Reboot,
+ "harddrive": commands.harddrive.F33_HardDrive,
+ "hmc": commands.hmc.F28_Hmc,
+ "ignoredisk": commands.ignoredisk.F34_IgnoreDisk,
+ "install": commands.install.F34_Install,
+ "iscsi": commands.iscsi.F17_Iscsi,
+ "iscsiname": commands.iscsiname.FC6_IscsiName,
+ "keyboard": commands.keyboard.F18_Keyboard,
+ "lang": commands.lang.F19_Lang,
+ "liveimg": commands.liveimg.F19_Liveimg,
+ "logging": commands.logging.F34_Logging,
+ "logvol": commands.logvol.RHEL9_LogVol,
+ "mediacheck": commands.mediacheck.FC4_MediaCheck,
+ "method": commands.method.F34_Method,
+ "mount": commands.mount.F27_Mount,
+ "multipath": commands.multipath.F34_MultiPath,
+ "network": commands.network.F27_Network,
+ "nfs": commands.nfs.FC6_NFS,
+ "nvdimm": commands.nvdimm.F28_Nvdimm,
+ "timesource": commands.timesource.F33_Timesource,
+ "ostreesetup": commands.ostreesetup.RHEL9_OSTreeSetup,
+ "part": commands.partition.RHEL9_Partition,
+ "partition": commands.partition.RHEL9_Partition,
+ "poweroff": commands.reboot.F23_Reboot,
+ "raid": commands.raid.RHEL9_Raid,
+ "realm": commands.realm.F19_Realm,
+ "reboot": commands.reboot.F23_Reboot,
+ "repo": commands.repo.F33_Repo,
+ "reqpart": commands.reqpart.F23_ReqPart,
+ "rescue": commands.rescue.F10_Rescue,
+ "rhsm": commands.rhsm.RHEL8_RHSM,
+ "rootpw": commands.rootpw.F37_RootPw,
+ "selinux": commands.selinux.FC3_SELinux,
+ "services": commands.services.FC6_Services,
+ "shutdown": commands.reboot.F23_Reboot,
+ "skipx": commands.skipx.FC3_SkipX,
+ "snapshot": commands.snapshot.F26_Snapshot,
+ "sshpw": commands.sshpw.F24_SshPw,
+ "sshkey": commands.sshkey.F22_SshKey,
+ "syspurpose" : commands.syspurpose.RHEL8_Syspurpose,
+ "text": commands.displaymode.F26_DisplayMode,
+ "timezone": commands.timezone.F33_Timezone,
+ "updates": commands.updates.F34_Updates,
+ "url": commands.url.F30_Url,
+ "user": commands.user.F24_User,
+ "vnc": commands.vnc.F9_Vnc,
+ "volgroup": commands.volgroup.RHEL9_VolGroup,
+ "xconfig": commands.xconfig.F14_XConfig,
+ "zerombr": commands.zerombr.F9_ZeroMbr,
+ "zfcp": commands.zfcp.F14_ZFCP,
+ "zipl": commands.zipl.F32_Zipl,
+ }
+
+ dataMap = {
+ "BTRFSData": commands.btrfs.F23_BTRFSData,
+ "DriverDiskData": commands.driverdisk.F14_DriverDiskData,
+ "DeviceData": commands.device.F8_DeviceData,
+ "DmRaidData": commands.dmraid.FC6_DmRaidData,
+ "ModuleData": commands.module.F31_ModuleData,
+ "TimesourceData": commands.timesource.F33_TimesourceData,
+ "FcoeData": commands.fcoe.RHEL9_FcoeData,
+ "GroupData": commands.group.F12_GroupData,
+ "IscsiData": commands.iscsi.F17_IscsiData,
+ "LogVolData": commands.logvol.F29_LogVolData,
+ "MountData": commands.mount.F27_MountData,
+ "MultiPathData": commands.multipath.FC6_MultiPathData,
+ "NetworkData": commands.network.F27_NetworkData,
+ "NvdimmData": commands.nvdimm.F28_NvdimmData,
+ "PartData": commands.partition.F29_PartData,
+ "RaidData": commands.raid.F29_RaidData,
+ "RepoData": commands.repo.F30_RepoData,
+ "SnapshotData": commands.snapshot.F26_SnapshotData,
+ "SshPwData": commands.sshpw.F24_SshPwData,
+ "SshKeyData": commands.sshkey.F22_SshKeyData,
+ "UserData": commands.user.F19_UserData,
+ "VolGroupData": commands.volgroup.RHEL9_VolGroupData,
+ "ZFCPData": commands.zfcp.F14_ZFCPData,
+ }
#
import gettext
import os
-import six
def _find_locale_files():
module_path = os.path.abspath(__file__)
locale_path = os.path.join(os.path.dirname(module_path), 'locale')
gettext.bindtextdomain("pykickstart", locale_path)
- gettext.textdomain("pykickstart")
_find_locale_files()
-if six.PY3:
- _ = lambda x: gettext.gettext(x) if x else ''
-else:
- _ = lambda x: gettext.lgettext(x) if x else ''
+_ = lambda x: gettext.translation("pykickstart", fallback=True).gettext(x) if x != "" else ""
#
import requests
import shutil
-import six
from pykickstart.errors import KickstartError
from pykickstart.i18n import _
from requests.exceptions import SSLError, RequestException
-_is_url = lambda location: '://' in location # RFC 3986
+is_url = lambda location: '://' in location # RFC 3986
SSL_VERIFY = True
Returns: string with contents
Raises: KickstartError on error reading'''
- if _is_url(location):
+ if is_url(location):
return _load_url(location)
else:
return _load_file(location)
Returns: file name with contents
Raises: KickstartError on error reading or writing'''
- if _is_url(location):
+ if is_url(location):
contents = _load_url(location)
# Write to file
'''Load a file's contents and return them as a string'''
try:
- if six.PY3:
- with open(filename, 'rb') as fh:
- contents = fh.read().decode("utf-8")
- else:
- with open(filename, 'r') as fh:
- contents = fh.read()
+ with open(filename, 'rb') as fh:
+ contents = fh.read().decode("utf-8")
except IOError as e:
raise KickstartError(_('Error opening file: %s') % str(e))
KickstartParser - The kickstart file parser state machine.
"""
-
-from __future__ import print_function
-
-try:
- from collections.abc import Iterator
-except ImportError: # python2 compatibility
- from collections import Iterator
+from collections.abc import Iterator
import os
-import six
import shlex
import sys
import warnings
lineno = 0
retval = ""
- if six.PY3:
- retval = retval.encode(sys.getdefaultencoding())
+ retval = retval.encode(sys.getdefaultencoding())
while True:
try:
ll = l.strip()
if not ll.startswith("%ksappend"):
- if six.PY3:
- l = l.encode(sys.getdefaultencoding())
- retval += l
+ retval += l.encode(sys.getdefaultencoding())
continue
# Try to pull down the remote file.
run. Returns the location of the complete kickstart file.
"""
s = preprocessFromStringToString(s)
- if s:
+ if s.strip():
import tempfile
(outF, outName) = tempfile.mkstemp(suffix="-ks.cfg")
run. Returns the location of the complete kickstart file.
"""
s = preprocessKickstartToString(f)
- if s:
+ if s.strip():
import tempfile
(outF, outName) = tempfile.mkstemp(suffix="-ks.cfg")
KS_BROKEN_IGNORE, KS_BROKEN_REPORT
from pykickstart.errors import KickstartParseError, KickstartDeprecationWarning
from pykickstart.options import KSOptionParser
-from pykickstart.version import FC4, F7, F9, F18, F21, F22, F24, F32, RHEL6, RHEL7
+from pykickstart.version import FC4, F7, F9, F18, F21, F22, F24, F32, F34, RHEL6, RHEL7, RHEL9, \
+ isRHEL
from pykickstart.i18n import _
class Section(object):
The error message will direct you to where the cause of
the failure is logged.""", version=FC4)
op.add_argument("--interpreter", dest="interpreter", default="/bin/sh",
- version=FC4, metavar="/usr/bin/python3", help="""
+ version=FC4, metavar="/usr/bin/python", help="""
Allows you to specify a different scripting language,
- such as Python. Replace /usr/bin/python3 with the
+ such as Python. Replace /usr/bin/python with the
scripting language of your choice.
""")
op.add_argument("--log", "--logfile", dest="log", version=FC4,
.. note::
- The pre-install script is not run in the chroot environment.
+ The pre-installation script is not run in the chroot environment.
"""
_epilog = """
Example
a bug in the installer. Some examples of these situations include errors in
packages that have been requested to be installed, failures when starting VNC
when requested, and error when scanning storage. When these situations happen,
- installaton cannot continue. The installer will run all %onerror scripts in
+ installation cannot continue. The installer will run all %onerror scripts in
the order they are provided in the kickstart file.
In addition, %onerror scripts will be run on a traceback as well. To be exact,
OnErrorScriptSection._resetScript(self)
self._script["type"] = KS_SCRIPT_TRACEBACK
+ def handleHeader(self, lineno, args):
+ super().handleHeader(lineno, args)
+
+ if self.version < F34:
+ return
+
+ warnings.warn("The %traceback section has been deprecated. It may be removed in the "
+ "future, which will result in a fatal error from kickstart. Please modify "
+ "your kickstart file to use the %onerror section instead.",
+ KickstartDeprecationWarning)
+
class PackageSection(Section):
sectionOpen = "%packages"
_title = "Package Selection"
op.remove_argument("--ignoredeps", version=F9)
op.remove_argument("--resolvedeps", version=F9)
- op.add_argument("--instLangs", "--inst-langs", default=None, version=F9, help="""
+ op.add_argument("--instLangs", default=None, version=F9, help="""
Specify the list of languages that should be installed.
This is different from the package group level
selections, though. This option does not specify what
if self.version < F24:
return op
- op.add_argument("--excludeWeakdeps", "--exclude-weakdeps", dest="excludeWeakdeps",
+ op.add_argument("--excludeWeakdeps", dest="excludeWeakdeps",
action="store_true", default=False, version=F24,
help="""
Do not install packages from weak dependencies. These
if self.version < F32:
return op
+ op.add_argument("--instLangs", "--inst-langs", dest="instLangs", default=None,
+ version=F32, help="Added ``--inst-langs`` alias")
+
+ op.add_argument("--excludeWeakdeps", "--exclude-weakdeps", dest="excludeWeakdeps",
+ action="store_true", default=False, version=F32,
+ help="Added ``--exclude-weakdeps`` alias")
+
op.add_argument("--ignorebroken", action="store_true", default=False, version=F32,
help="""
Ignore any packages, groups or modules with conflicting files.
were skipped. Using this option may result in an unusable system.**
""")
+ if isRHEL(self.version):
+ # The --ignorebroken feature is not supported on RHEL.
+ op.remove_argument("--ignorebroken", version=RHEL9)
+
return op
def handleHeader(self, lineno, args):
if self.version < F32:
return
- if ns.ignorebroken:
+ if getattr(ns, "ignorebroken", False):
self.handler.packages.handleBroken = KS_BROKEN_IGNORE
else:
self.handler.packages.handleBroken = KS_BROKEN_REPORT
- for option, new_option in \
+ for arg in args:
+ for option, new_option in \
{"--instLangs": "--inst-langs", "--excludeWeakdeps": "--exclude-weakdeps"}.items():
- if option in args:
- warnings.warn(_("The %(option)s option on line %(lineno)s will be deprecated in "
- "future releases. Please modify your kickstart file to replace "
- "this option with its preferred alias %(new_option)s.")
- % {"option": option, "lineno": lineno, "new_option": new_option},
- KickstartDeprecationWarning)
+ if option in arg:
+ warnings.warn(_("The %(option)s option on line %(lineno)s will be deprecated in "
+ "future releases. Please modify your kickstart file to replace "
+ "this option with its preferred alias %(new_option)s.")
+ % {"option": option, "lineno": lineno, "new_option": new_option},
+ KickstartDeprecationWarning)
F32 = 32000
F33 = 33000
F34 = 34000
+RHEL9 = 34100
+F35 = 35000
+F36 = 36000
+F37 = 37000
# This always points at the latest version and is the default.
-DEVEL = F34
+DEVEL = F37
# A one-to-one mapping from string representations to version numbers.
versionMap = {
"F19": F19, "F20": F20, "F21": F21, "F22": F22, "F23": F23,
"F24": F24, "F25": F25, "F26": F26, "F27": F27, "F28": F28,
"F29": F29, "F30": F30, "F31": F31, "F32": F32, "F33": F33,
- "F34": F34,
+ "F34": F34, "F35": F35, "F36": F36, "F37": F37,
"RHEL3": RHEL3, "RHEL4": RHEL4, "RHEL5": RHEL5, "RHEL6": RHEL6,
- "RHEL7": RHEL7, "RHEL8": RHEL8
+ "RHEL7": RHEL7, "RHEL8": RHEL8, "RHEL9": RHEL9
}
def stringToVersion(s):
def getVersionFromCommandClass(cls):
return versionMap[cls.__name__.split('_')[0]]
+
+def isRHEL(version):
+ return "RHEL" in versionToString(version, skipDevel=True)