def _getParser(self): op = super(F17_Iscsi, self)._getParser() for action in op._actions: # mark the fact that --iface is available since F17 # while RHEL6 is based on F12 if '--iface' in action.option_strings: action.help = action.help.replace(versionToLongString(RHEL6), versionToLongString(F17)) return op
def _getParser(self): op = super(self.__class__, self)._getParser() for action in op._actions: # mark the fact that --iface is available since F17 # while RHEL6 is based on F12 if '--iface' in action.option_strings: action.help = action.help.replace( versionToLongString(RHEL6), versionToLongString(F17) ) return op
def add_argument(self, *args, **kwargs): if "introduced" in kwargs: warnings.warn("The option 'introduced' will be removed in a future release. " "Use 'version' instead.", PendingDeprecationWarning) if "removed" in kwargs: warnings.warn("The option 'removed' will be removed in a future release. " "Use 'remove_argument' instead.", PendingDeprecationWarning) introduced = kwargs.pop("introduced", None) deprecated = kwargs.pop("deprecated", False) if deprecated: version = versionToLongString(deprecated) else: # fail fast if version is missing version = versionToLongString(introduced or kwargs.pop("version")) candidate = None for action in self._actions: for arg in args: if arg in action.option_strings: candidate = action break if candidate: if deprecated: _help = candidate.help or "" _help += "\n\n .. deprecated:: %s" % version kwargs["help"] = _help else: # this is a modified argument, which is already present _help = candidate.help or "" _help += "\n\n .. versionchanged:: %s\n\n%s" % (version, kwargs.pop("help")) kwargs["help"] = _help else: # this is a new argument which is added for the first time _help = kwargs.pop("help") _help += "\n\n .. versionadded:: %s" % version # there are some argumets which are deprecated on first declaration if deprecated: _help += "\n\n .. deprecated:: %s" % version kwargs["help"] = _help notest = kwargs.pop("notest", False) removed = kwargs.pop("removed", None) action = ArgumentParser.add_argument(self, *args, **kwargs) action.deprecated = deprecated action.introduced = introduced action.notest = notest action.removed = removed return action
def _getParser(self): op = FC5_Raid._getParser(self) for action in op._actions: if "--level" in action.option_strings: action.help += dedent(""" .. versionchanged:: %s The "RAID10" level was added.""" % versionToLongString(RHEL5)) break op.add_argument("--encrypted", action="store_true", default=False, version=RHEL5, help=""" Specify that this RAID device should be encrypted. """) op.add_argument("--passphrase", version=RHEL5, help=""" Specify the passphrase to use when encrypting this RAID device. Without the above --encrypted option, this option does nothing. If no passphrase is specified, the default system-wide one is used, or the installer will stop and prompt if there is no default.""") return op
def _getParser(self): "Only necessary for the type change documentation" op = F29_AutoPart._getParser(self) for action in op._actions: if "--type" in action.option_strings: action.help += """ .. versionchanged:: %s Partitioning scheme 'btrfs' was removed.""" % versionToLongString(RHEL8) if "--fstype" in action.option_strings: action.help += """ .. versionchanged:: %s Partitioning scheme 'btrfs' was removed.""" % versionToLongString(RHEL8) return op
def _getParser(self): op = FC3_Keyboard._getParser(self) op.description += dedent(""" .. versionchanged:: %s See the documentation of ``--vckeymap`` option and the tip at the end of this section for a guide how to get values accepted by this command. Either ``--vckeymap`` or ``--xlayouts`` must be used. Alternatively, use the older format, ``arg``, which is still supported. ``arg`` can be an X layout or VConsole keymap name. Missing values will be automatically converted from the given one(s). """ % versionToLongString(F18)) op.add_argument("--vckeymap", dest="vc_keymap", default="", help=""" Specify VConsole keymap that should be used. is a keymap name which is the same as the filename under ``/usr/lib/kbd/keymaps/`` without the ``.map.gz`` extension. """, version=F18) op.add_argument("--xlayouts", dest="x_layouts", type=commaSplit, version=F18, help=""" Specify a list of X layouts that should be used (comma-separated list without spaces). Accepts the same values as ``setxkbmap(1)``, but uses either the layout format (such as cz) or the 'layout (variant)' format (such as 'cz (qwerty)'). For example:: ``keyboard --xlayouts=cz,'cz (qwerty)'`""") op.add_argument("--switch", dest="switch_options", type=commaSplit, version=F18, help=""" Specify a list of layout switching options that should be used (comma-separated list without spaces). Accepts the same values as ``setxkbmap(1)`` for layout switching. For example:: ``keyboard --xlayouts=cz,'cz (qwerty)' --switch=grp:alt_shift_toggle`` """) op.epilog = dedent(""" *If you know only the description of the layout (e.g. Czech (qwerty)), you can use http://vpodzime.fedorapeople.org/layouts_list.py to list all available layouts and find the one you want to use. The string in square brackets is the valid layout specification as Anaconda accepts it. The same goes for switching options and http://vpodzime.fedorapeople.org/switching_list.py*""") return op
def _getParser(self): "Only necessary for the type change documentation" op = F29_AutoPart._getParser(self) for action in op._actions: if "--type" in action.option_strings: action.help += """ .. versionchanged:: %s Partitioning scheme 'btrfs' was removed.""" % versionToLongString( RHEL8) if "--fstype" in action.option_strings: action.help += """ .. versionchanged:: %s Partitioning scheme 'btrfs' was removed.""" % versionToLongString( RHEL8) return op
def _getParser(self): op = FC6_Network._getParser(self) for action in op._actions: if "--bootproto" in action.option_strings: action.help += dedent(""" .. versionchanged:: %s The 'query' value was added.""" % versionToLongString(RHEL5)) break return op
def _getParser(self): op = F12_Raid._getParser(self) for action in op._actions: if "--level" in action.option_strings: action.help += dedent(""" .. versionchanged:: %s The "RAID4" level was added.""" % versionToLongString(F13)) break return op
def _getParser(self): "Only necessary for the type change documentation" op = F29_LogVol._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
def _getParser(self): "Only necessary for the type change documentation" op = F18_AutoPart._getParser(self) for action in op._actions: if "--type" in action.option_strings: action.help += """ .. versionchanged:: %s Partitioning scheme 'thinp' was added.""" % versionToLongString(F20) return op
def _getParser(self): op = F11_Upgrade._getParser(self) op.description += dedent(""" .. deprecated:: %s Starting with F18, upgrades are no longer supported in anaconda and should be done with FedUp, the Fedora update tool. Starting with F21, the DNF system-upgrade plugin is recommended instead. Therefore, the upgrade command essentially does nothing.""" % versionToLongString(F20)) return op
def _getParser(self): op = F14_Repo._getParser(self) for action in op._actions: for option in ['--baseurl', '--mirrorlist']: if option in action.option_strings: action.help += dedent(""" .. versionchanged:: %s ``--mirrorlist`` and ``--baseurl`` are not required anymore! """ % versionToLongString(F15)) return op
def _getParser(self): op = F9_Network._getParser(self) for action in op._actions: if "--bootproto" in action.option_strings: action.help += dedent(""" .. versionchanged:: %s The 'ibft' value was added.""" % versionToLongString(RHEL6)) break op.add_argument("--activate", action="store_true", version=RHEL6, default=None, help=""" Activate this device in the installation environment. If the device has already been activated (for example, an interface you configured with boot options so that the system could retrieve the Kickstart file) the device is reactivated to use the configuration specified in the Kickstart file.""") op.add_argument("--nodefroute", action="store_true", version=RHEL6, default=False, help=""" Prevents the interface being set as the default route. Use this option when you activate additional devices with the ``--activate=`` option, for example, a NIC on a separate subnet for an iSCSI target.""") op.add_argument("--vlanid", version=RHEL6, help=""" Id (802.1q tag) of vlan device to be created using parent device specified by ``--device`` option. For example:: ``network --device=eth0 --vlanid=171`` will create vlan device ``eth0.171``.""") op.add_argument("--bondslaves", version=RHEL6, help=""" Bonded device with name specified by ``--device`` option will be created using slaves specified in this option. Example:: ``network --device bond0 --bootproto static --ip=10.34.102.222 --netmask=255.255.255.0 --gateway=10.34.102.254 --nameserver=10.34.39.2 --bondslaves=eth0,eth1 --bondopts=mode=active-backup,primary=eth0 --activate`` """) op.add_argument("--bondopts", version=RHEL6, help=""" A comma-separated list of optional parameters for bonded interface specified by ``--bondslaves`` and ``--device`` options. Example:: ``--bondopts=mode=active-backup,primary=eth1`` If an option itself contains comma as separator use semicolon to separate the options. Example:: ``--bondopts=mode=active-backup,balance-rr;primary=eth1`` """) return op
def _getParser(self): op = super(F28_Authconfig, self)._getParser() op.description += dedent(""" .. versionchanged:: %s The authconfig program is deprecated. This command will use the authconfig compatibility tool, but you should use the authselect command instead. """ % versionToLongString(F28)) return op
def remove_argument(self, arg, **kwargs): candidate = None for action in self._actions: if arg in action.option_strings: candidate = action break if candidate: if not candidate.help: candidate.help = "" candidate.help += "\n\n .. versionremoved:: %s" % versionToLongString(kwargs.pop("version")) self._remove_action(candidate) self._option_string_actions.pop(arg)
def __init__(self, *args, **kwargs): """Create a new KSOptionParser instance. Each KickstartCommand subclass should create one instance of KSOptionParser, providing at least the lineno attribute. version is not required. Instance attributes: version -- The version when the kickstart command was introduced. """ # Overridden to allow for the version kwargs, to skip help option generation, # and to resolve conflicts instead of override earlier options. int_version = kwargs.pop("version") # fail fast if no version is specified version = versionToLongString(int_version) # always document the version if "addVersion" in kwargs: warnings.warn("The option 'addVersion' will be removed in a future release.", PendingDeprecationWarning) addVersion = kwargs.pop('addVersion', True) # remove leading spaced from description and epilog. # fail fast if we forgot to add description kwargs['description'] = textwrap.dedent(kwargs.pop("description")) if addVersion: kwargs['description'] = "\n.. versionadded:: %s\n%s" % (version, kwargs['description']) kwargs['epilog'] = textwrap.dedent(kwargs.pop("epilog", "")) # fail fast if we forgot to add prog kwargs['prog'] = kwargs.pop("prog") # remove leading spaced from description and epilog. # fail fast if we forgot to add description kwargs['description'] = textwrap.dedent(kwargs.pop("description")) kwargs['epilog'] = textwrap.dedent(kwargs.pop("epilog", "")) # fail fast if we forgot to add prog kwargs['prog'] = kwargs.pop("prog") ArgumentParser.__init__(self, add_help=False, conflict_handler="resolve", formatter_class=KSHelpFormatter, *args, **kwargs) # NOTE: On Python 2.7 ArgumentParser has a deprecated version parameter # which always defaults to self.version = None which breaks deprecation # warnings in pykickstart. That's why we always set this value after # ArgumentParser.__init__ has been executed self.version = int_version self.lineno = None
def _getParser(self): op = FC6_Reboot._getParser(self) op.prog += "|halt" op.description += dedent(""" ``halt`` At the end of installation, display a message and wait for the user to press a key before rebooting. This is the default action. .. versionchanged:: %s The 'halt' command was added! """ % versionToLongString(F18)) return op
def _getParser(self): op = F9_Network._getParser(self) for action in op._actions: if "--bootproto" in action.option_strings: action.help += dedent(""" .. versionchanged:: %s The 'ibft' value was added.""" % \ versionToLongString(RHEL6)) break op.add_argument("--activate", action="store_true", version=RHEL6, default=False, help=""" As noted above, using this option ensures any matching devices beyond the first will also be activated.""") op.add_argument("--nodefroute", action="store_true", version=RHEL6, default=False, help=""" Prevents grabbing of the default route by the device. It can be useful when activating additional devices in installer using ``--activate`` option.""") op.add_argument("--vlanid", version=RHEL6, help=""" Id (802.1q tag) of vlan device to be created using parent device specified by ``--device`` option. For example:: ``network --device=eth0 --vlanid=171`` will create vlan device ``eth0.171``.""") op.add_argument("--bondslaves", version=RHEL6, help=""" Bonded device with name specified by ``--device`` option will be created using slaves specified in this option. Example:: ``--bondslaves=eth0,eth1``. """) op.add_argument("--bondopts", version=RHEL6, help=""" A comma-separated list of optional parameters for bonded interface specified by ``--bondslaves`` and ``--device`` options. Example:: ``--bondopts=mode=active-backup,primary=eth1``. If an option itself contains comma as separator use semicolon to separate the options.""") return op
def _getParser(self): op = F21_Repo._getParser(self) op.add_argument("--metalink", version=F27, help=""" The URL pointing at a metalink for the repository. The variables that may be used in yum repo config files are not supported here. You may use only one of the ``--baseurl``, ``--mirrorlist``, or ``--metalink`` options. Variable substitution is done for $releasever and $basearch in the url.""") for action in op._actions: for option in ['--baseurl', '--mirrorlist']: if option in action.option_strings: action.help += dedent(""" .. versionchanged:: %s ``Another mutually exclusive option --metalink`` was added. """ % versionToLongString(F27)) return op
def _getParser(self): op = F9_Network._getParser(self) for action in op._actions: if "--bootproto" in action.option_strings: action.help += dedent(""" .. versionchanged:: %s The 'ibft' value was added.""" % versionToLongString(F16)) break op.add_argument("--activate", action="store_true", version=F16, default=None, help=""" As noted above, using this option ensures any matching devices beyond the first will also be activated.""") op.add_argument("--nodefroute", action="store_true", version=F16, default=False, help=""" Prevents grabbing of the default route by the device. It can be useful when activating additional devices in installer using ``--activate`` option.""") op.add_argument("--wpakey", default="", version=F16, help=""" The WPA encryption key for wireless networks.""") return op
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 __init__(self, *args, **kwargs): """Create a new KSOptionParser instance. Each KickstartCommand subclass should create one instance of KSOptionParser, providing at least the lineno attribute. version is not required. Instance attributes: version -- The version of the kickstart syntax we are checking against. """ # Overridden to allow for the version kwargs, to skip help option generation, # and to resolve conflicts instead of override earlier options. version = kwargs.pop("version") # fail fast if no version specified self.version = version version = versionToLongString(version) # remove leading spaced from description and epilog. # fail fast if we forgot to add description kwargs['description'] = textwrap.dedent(kwargs.pop("description")) kwargs['description'] = "\n.. versionadded:: %s\n%s" % (version, kwargs['description']) kwargs['epilog'] = textwrap.dedent(kwargs.pop("epilog", "")) # fail fast if we forgot to add prog kwargs['prog'] = kwargs.pop("prog") # remove leading spaced from description and epilog. # fail fast if we forgot to add description kwargs['description'] = textwrap.dedent(kwargs.pop("description")) kwargs['epilog'] = textwrap.dedent(kwargs.pop("epilog", "")) # fail fast if we forgot to add prog kwargs['prog'] = kwargs.pop("prog") ArgumentParser.__init__(self, add_help=False, conflict_handler="resolve", formatter_class=KSHelpFormatter, *args, **kwargs) self.lineno = None
def _getParser(self): op = FC3_LangSupport._getParser(self) op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC5) return op
def _getParser(self): op = KSOptionParser(prog="lilocheck", description="", version=FC3) op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC4) return op
def _getParser(self): op = F23_BTRFS._getParser(self) op.description += "\n\n.. deprecated:: %s" % versionToLongString(RHEL8) return op
def _getParser(self): op = FC3_Interactive._getParser(self) op.description += "\n\n.. versiondeprecated:: %s" % \ versionToLongString(F14) return op
def _getParser(self): op = F20_Install._getParser(self) op.description += "\n\n.. deprecated:: %s" % versionToLongString(F29) return op
def _getParser(self): op = F8_Device._getParser(self) op.description += "\n\n.. deprecated:: %s" % versionToLongString(F24) return op
def _getParser(self): op = FC6_MultiPath._getParser(self) op.description += "\n\n.. deprecated:: %s" % versionToLongString(F24) return op
def _getParser(self): op = FC6_Monitor._getParser(self) op.description += "\n\n.. deprecated:: %s" % versionToLongString(F10) return op
def _getParser(self): op = super(FC3_Lilo, self)._getParser() op.prog = "lilo" op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC4) return op
def _getParser(self): op = RHEL3_Mouse._getParser(self) op.description += "\n\n.. deprecated:: %s" % versionToLongString(FC3) return op
def _getParser(self): op = RHEL3_Mouse._getParser(self) op.description += "\n\n.. deprecated: %s" % versionToLongString(FC3) return op
def _getParser(self): op = F29_Install._getParser(self) op.description += "\n\n.. versionremoved:: %s" % versionToLongString( F34) return op