本文整理汇总了Python中pykickstart.options.KSOptionParser.add_argument方法的典型用法代码示例。如果您正苦于以下问题:Python KSOptionParser.add_argument方法的具体用法?Python KSOptionParser.add_argument怎么用?Python KSOptionParser.add_argument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pykickstart.options.KSOptionParser
的用法示例。
在下文中一共展示了KSOptionParser.add_argument方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="volgroup", description="""
Creates a Logical Volume Management (LVM) group.
""", epilog="""
Create the partition first, create the logical
volume group, and then create the logical volume.
For example::
part pv.01 --size 3000
volgroup myvg pv.01
logvol / --vgname=myvg --size=2000 --name=rootvol
""", version=FC3)
op.add_argument("name", metavar="<name>", nargs="*", version=FC3, help="""
Name given to the volume group. The (which denotes that
multiple partitions can be listed) lists the identifiers
to add to the volume group.""")
op.add_argument("partitions", metavar="<partitions*>", nargs="*", help="""
Physical Volume partitions to be included in this
Volume Group""", version=FC3)
op.add_argument("--noformat", dest="format", action="store_false",
default=True, version=FC3, help="""
Use an existing volume group. Do not specify partitions
when using this option.""")
op.add_argument("--pesize", type=int, default=32768, version=FC3,
help="""
Set the size of the physical extents in KiB.""")
op.add_argument("--useexisting", dest="preexist", action="store_true",
default=False, version=FC3, help="""
Use an existing volume group. Do not specify partitions
when using this option.""")
return op
示例2: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="clearpart", description="""
Removes partitions from the system, prior to creation
of new partitions. By default, no partitions are
removed.
If the clearpart command is used, then the ``--onpart``
command cannot be used on a logical partition.""",
version=FC3)
op.add_argument("--all", dest="type", action="store_const",
const=CLEARPART_TYPE_ALL, version=FC3,
help="Erases all partitions from the system.")
op.add_argument("--drives", type=commaSplit, help="""
Specifies which drives to clear partitions from. For
example, the following clears the partitions on the
first two drives on the primary IDE controller::
``clearpart --all --drives=sda,sdb``""",
version=FC3)
op.add_argument("--initlabel", dest="initAll", action="store_true",
default=False, version=FC3, help="""
Initializes the disk label to the default for your
architecture (for example msdos for x86 and gpt for
Itanium). This is only meaningful in combination with
the '--all' option.""")
op.add_argument("--linux", dest="type", action="store_const",
const=CLEARPART_TYPE_LINUX, version=FC3,
help="Erases all Linux partitions.")
op.add_argument("--none", dest="type", action="store_const",
const=CLEARPART_TYPE_NONE, version=FC3, help="""
Do not remove any partitions. This is the default""")
return op
示例3: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="module", description="""
The module command makes it possible to manipulate
modules.
(In this case we mean modules as introduced by the
Fedora modularity initiative.)
A module is defined by a unique name and a stream id,
where single module can (and usually has) multiple
available streams.
Streams will in most cases corresponds to stable
releases of the given software components
(such as Node.js, Django, etc.) but there could be
also other use cases, such as a raw upstream master
branch stream or streams corresponding to an upcoming
stable release.
For more information see the Fedora modularity
initiative documentation:
https://docs.pagure.org/modularity/""", version=F29)
op.add_argument("--name", metavar="<module_name>", version=F29, required=True,
help="""
Name of the module to enable.""")
op.add_argument("--stream", metavar="<module_stream_name>", version=F29, required=False,
help="""
Name of the module stream to enable.""")
return op
示例4: _processGroup
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _processGroup(self, line):
op = KSOptionParser(prog="", description="", version=version.DEVEL)
op.add_argument("--nodefaults", action="store_true", default=False,
help="", version=version.DEVEL)
op.add_argument("--optional", action="store_true", default=False,
help="", version=version.DEVEL)
(ns, extra) = op.parse_known_args(args=line.split())
if ns.nodefaults and ns.optional:
raise KickstartParseError(_("Group cannot specify both --nodefaults and --optional"))
# If the group name has spaces in it, we have to put it back together
# now.
grp = " ".join(extra)
if grp in [g.name for g in self.groupList]:
return
if ns.nodefaults:
self.groupList.append(Group(name=grp, include=constants.GROUP_REQUIRED))
elif ns.optional:
self.groupList.append(Group(name=grp, include=constants.GROUP_ALL))
else:
self.groupList.append(Group(name=grp, include=constants.GROUP_DEFAULT))
示例5: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="nvdimm", version=F28, description="""
Perform an action on an nvdimm device.""")
op.add_argument("action", choices=self.validActions, nargs=1, default=NVDIMM_ACTION_RECONFIGURE,
version=F28, help="""
The action to be performed on the device specified by further options.
The device can be specified by ``--namespace`` or ``--blockdevs`` options,
depending on the action.
Valid actions:
- ``reconfigure``: Reconfigures the device specified by ``--namespace``
into the mode specified by ``--mode`` and (depending on the mode)
``--sectorsize`` options. The device reconfigured into sector mode
will be allowed to be used for storage configuration.
- ``use``: Allow the device to be used for storage configuration. By default nvdimm
devices are ignored. Only devices in sector mode can be used.
""")
op.add_argument("--namespace", metavar="<namespace>", version=F28,
help="""The device specification by namespace.""")
op.add_argument("--blockdevs", metavar="<devspec1>,<devspec2>,...,<devspecN>", type=commaSplit, version=F28,
help="""Specification of devices by comma separated list of block device names.""")
op.add_argument("--mode", choices=self.validModes, default=NVDIMM_MODE_SECTOR,
version=F28, help="""The mode specification.""")
op.add_argument("--sectorsize", type=int, version=F28,
help="""Size of a sector for sector mode.""")
return op
示例6: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="mouse", description="""
Configure the system mouse""", version=RHEL3)
op.add_argument("--device", default="", version=RHEL3,
help="Which device node to use for mouse")
op.add_argument("--emulthree", default=False, action="store_true",
version=RHEL3, help="If set emulate 3 mouse buttons")
return op
示例7: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="url", description="""
Install from an installation tree on a remote server
via FTP or HTTP.""", version=FC3)
op.add_argument("--url", required=True, version=FC3, help="""
The URL to install from. Variable substitution is done
for $releasever and $basearch in the url.""")
return op
示例8: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
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.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
示例9: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="fcoe", description="""
Discover and attach FCoE storage devices accessible via
specified network interface
""", version=F12)
op.add_argument("--nic", required=True, version=F12, help="""
Name of the network device connected to the FCoE switch""")
return op
示例10: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser()
op.add_argument("--all", dest="type", action="store_const", const=CLEARPART_TYPE_ALL)
op.add_argument("--drives", type=commaSplit)
op.add_argument("--initlabel", dest="initAll", action="store_true", default=False)
op.add_argument("--linux", dest="type", action="store_const", const=CLEARPART_TYPE_LINUX)
op.add_argument("--none", dest="type", action="store_const", const=CLEARPART_TYPE_NONE)
return op
示例11: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="eula", version=F20, description="""
Automatically accept Red Hat's EULA""")
# people would struggle remembering the exact word
op.add_argument("--agreed", "--agree", "--accepted", "--accept",
dest="agreed", action="store_true", default=False,
version=F20, help="Accept the EULA. This is mandatory option!")
return op
示例12: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="iscsiname", description="""
Assigns an initiator name to the computer. If you use the iscsi
parameter in your kickstart file, this parameter is mandatory, and
you must specify iscsiname in the kickstart file before you specify
iscsi.""", version=FC6)
op.add_argument("iqn", metavar="<iqn>", nargs=1, version=FC6, help="""
IQN name""")
return op
示例13: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="ignoredisk", description="""
Controls anaconda's access to disks attached to the system. By
default, all disks will be available for partitioning. Only one of
the following three options may be used.""", version=FC3)
op.add_argument("--drives", dest="ignoredisk", type=commaSplit,
required=True, version=FC3, help="""
Specifies those disks that anaconda should not touch
when partitioning, formatting, and clearing.""")
return op
示例14: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="group", description="""
Creates a new user group on the system. If a group with the given
name or GID already exists, this command will fail. In addition,
the ``user`` command can be used to create a new group for the
newly created user.""", version=F12)
op.add_argument("--name", required=True, version=F12,
help="Provides the name of the new group.")
op.add_argument("--gid", type=int, version=F12, help="""
The group's GID. If not provided, this defaults to the
next available non-system GID.""")
return op
示例15: _getParser
# 需要导入模块: from pykickstart.options import KSOptionParser [as 别名]
# 或者: from pykickstart.options.KSOptionParser import add_argument [as 别名]
def _getParser(self):
op = KSOptionParser(prog="authselect", description="""
This command sets up the authentication options
for the system. This is just a wrapper around the
authselect program, so all options recognized by
that program are valid for this command. See the
manual page for authselect for a complete list.""",
version=F28)
op.add_argument("options", metavar="[options]", help="""
See ``man authselect``.""", version=F28)
return op