| |
@@ -25,7 +25,6 @@
|
| |
from koji_cli.lib import (
|
| |
TimeOption,
|
| |
DatetimeJSONEncoder,
|
| |
- _,
|
| |
_list_tasks,
|
| |
_progress_callback,
|
| |
_running_in_bg,
|
| |
@@ -69,17 +68,17 @@
|
| |
|
| |
def handle_add_group(goptions, session, args):
|
| |
"[admin] Add a group to a tag"
|
| |
- usage = _("usage: %prog add-group <tag> <group>")
|
| |
+ usage = "usage: %prog add-group <tag> <group>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Please specify a tag name and a group name"))
|
| |
+ parser.error("Please specify a tag name and a group name")
|
| |
tag = args[0]
|
| |
group = args[1]
|
| |
|
| |
activate_session(session, goptions)
|
| |
if not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
- parser.error(_("This action requires tag or admin privileges"))
|
| |
+ parser.error("This action requires tag or admin privileges")
|
| |
|
| |
dsttag = session.getTag(tag)
|
| |
if not dsttag:
|
| |
@@ -95,17 +94,17 @@
|
| |
|
| |
def handle_block_group(goptions, session, args):
|
| |
"[admin] Block group in tag"
|
| |
- usage = _("usage: %prog block-group <tag> <group>")
|
| |
+ usage = "usage: %prog block-group <tag> <group>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Please specify a tag name and a group name"))
|
| |
+ parser.error("Please specify a tag name and a group name")
|
| |
tag = args[0]
|
| |
group = args[1]
|
| |
|
| |
activate_session(session, goptions)
|
| |
if not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
- parser.error(_("This action requires tag or admin privileges"))
|
| |
+ parser.error("This action requires tag or admin privileges")
|
| |
|
| |
dsttag = session.getTag(tag)
|
| |
if not dsttag:
|
| |
@@ -121,51 +120,51 @@
|
| |
|
| |
def handle_remove_group(goptions, session, args):
|
| |
"[admin] Remove group from tag"
|
| |
- usage = _("usage: %prog remove-group <tag> <group>")
|
| |
+ usage = "usage: %prog remove-group <tag> <group>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Please specify a tag name and a group name"))
|
| |
+ parser.error("Please specify a tag name and a group name")
|
| |
tag = args[0]
|
| |
group = args[1]
|
| |
|
| |
activate_session(session, goptions)
|
| |
if not (session.hasPerm('admin') or session.hasPerm('tag')):
|
| |
- parser.error(_("This action requires tag or admin privileges"))
|
| |
+ parser.error("This action requires tag or admin privileges")
|
| |
|
| |
dsttag = session.getTag(tag)
|
| |
if not dsttag:
|
| |
- error(_("No such tag: %s") % tag)
|
| |
+ error("No such tag: %s" % tag)
|
| |
|
| |
groups = dict([(p['name'], p['group_id']) for p in session.getTagGroups(tag, inherit=False)])
|
| |
group_id = groups.get(group, None)
|
| |
if group_id is None:
|
| |
- error(_("Group %s doesn't exist within tag %s" % (group, tag)))
|
| |
+ error("Group %s doesn't exist within tag %s" % (group, tag))
|
| |
|
| |
session.groupListRemove(tag, group)
|
| |
|
| |
|
| |
def handle_assign_task(goptions, session, args):
|
| |
"[admin] Assign a task to a host"
|
| |
- usage = _('usage: %prog assign-task <task_id> <hostname>')
|
| |
+ usage = 'usage: %prog assign-task <task_id> <hostname>'
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option('-f', '--force', action='store_true', default=False,
|
| |
- help=_('force to assign a non-free task'))
|
| |
+ help='force to assign a non-free task')
|
| |
(options, args) = parser.parse_args(args)
|
| |
|
| |
if len(args) != 2:
|
| |
- parser.error(_('please specify a task id and a hostname'))
|
| |
+ parser.error('please specify a task id and a hostname')
|
| |
else:
|
| |
task_id = int(args[0])
|
| |
hostname = args[1]
|
| |
|
| |
taskinfo = session.getTaskInfo(task_id, request=False)
|
| |
if taskinfo is None:
|
| |
- raise koji.GenericError(_("No such task: %s") % task_id)
|
| |
+ raise koji.GenericError("No such task: %s" % task_id)
|
| |
|
| |
hostinfo = session.getHost(hostname)
|
| |
if hostinfo is None:
|
| |
- raise koji.GenericError(_("No such host: %s") % hostname)
|
| |
+ raise koji.GenericError("No such host: %s" % hostname)
|
| |
|
| |
force = False
|
| |
if options.force:
|
| |
@@ -173,7 +172,7 @@
|
| |
|
| |
activate_session(session, goptions)
|
| |
if not session.hasPerm('admin'):
|
| |
- parser.error(_("This action requires admin privileges"))
|
| |
+ parser.error("This action requires admin privileges")
|
| |
|
| |
ret = session.assignTask(task_id, hostname, force)
|
| |
if ret:
|
| |
@@ -184,15 +183,15 @@
|
| |
|
| |
def handle_add_host(goptions, session, args):
|
| |
"[admin] Add a host"
|
| |
- usage = _("usage: %prog add-host [options] <hostname> <arch> [<arch> ...]")
|
| |
+ usage = "usage: %prog add-host [options] <hostname> <arch> [<arch> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--krb-principal",
|
| |
- help=_("set a non-default kerberos principal for the host"))
|
| |
+ help="set a non-default kerberos principal for the host")
|
| |
parser.add_option("--force", default=False, action="store_true",
|
| |
- help=_("if existing used is a regular user, convert it to a host"))
|
| |
+ help="if existing used is a regular user, convert it to a host")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("Please specify a hostname and at least one arch"))
|
| |
+ parser.error("Please specify a hostname and at least one arch")
|
| |
host = args[0]
|
| |
activate_session(session, goptions)
|
| |
id = session.getHost(host)
|
| |
@@ -208,16 +207,16 @@
|
| |
|
| |
def handle_edit_host(options, session, args):
|
| |
"[admin] Edit a host"
|
| |
- usage = _("usage: %prog edit-host <hostname> [<hostname> ...] [options]")
|
| |
+ usage = "usage: %prog edit-host <hostname> [<hostname> ...] [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--arches",
|
| |
- help=_("Space or comma-separated list of supported architectures"))
|
| |
- parser.add_option("--capacity", type="float", help=_("Capacity of this host"))
|
| |
- parser.add_option("--description", metavar="DESC", help=_("Description of this host"))
|
| |
- parser.add_option("--comment", help=_("A brief comment about this host"))
|
| |
+ help="Space or comma-separated list of supported architectures")
|
| |
+ parser.add_option("--capacity", type="float", help="Capacity of this host")
|
| |
+ parser.add_option("--description", metavar="DESC", help="Description of this host")
|
| |
+ parser.add_option("--comment", help="A brief comment about this host")
|
| |
(subopts, args) = parser.parse_args(args)
|
| |
if not args:
|
| |
- parser.error(_("Please specify a hostname"))
|
| |
+ parser.error("Please specify a hostname")
|
| |
|
| |
activate_session(session, options)
|
| |
|
| |
@@ -234,32 +233,32 @@
|
| |
error_hit = False
|
| |
for host, [info] in zip(args, session.multiCall(strict=True)):
|
| |
if not info:
|
| |
- warn(_("No such host: %s") % host)
|
| |
+ warn("No such host: %s" % host)
|
| |
error_hit = True
|
| |
|
| |
if error_hit:
|
| |
- error(_("No changes made, please correct the command line"))
|
| |
+ error("No changes made, please correct the command line")
|
| |
|
| |
session.multicall = True
|
| |
for host in args:
|
| |
session.editHost(host, **vals)
|
| |
for host, [result] in zip(args, session.multiCall(strict=True)):
|
| |
if result:
|
| |
- print(_("Edited %s") % host)
|
| |
+ print("Edited %s" % host)
|
| |
else:
|
| |
- print(_("No changes made to %s") % host)
|
| |
+ print("No changes made to %s" % host)
|
| |
|
| |
|
| |
def handle_add_host_to_channel(goptions, session, args):
|
| |
"[admin] Add a host to a channel"
|
| |
- usage = _("usage: %prog add-host-to-channel [options] <hostname> <channel>")
|
| |
+ usage = "usage: %prog add-host-to-channel [options] <hostname> <channel>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--list", action="store_true", help=SUPPRESS_HELP)
|
| |
- parser.add_option("--new", action="store_true", help=_("Create channel if needed"))
|
| |
- parser.add_option("--force", action="store_true", help=_("force added, if possible"))
|
| |
+ parser.add_option("--new", action="store_true", help="Create channel if needed")
|
| |
+ parser.add_option("--force", action="store_true", help="force added, if possible")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if not options.list and len(args) != 2:
|
| |
- parser.error(_("Please specify a hostname and a channel"))
|
| |
+ parser.error("Please specify a hostname and a channel")
|
| |
activate_session(session, goptions)
|
| |
if options.list:
|
| |
for channel in session.listChannels():
|
| |
@@ -285,11 +284,11 @@
|
| |
|
| |
def handle_remove_host_from_channel(goptions, session, args):
|
| |
"[admin] Remove a host from a channel"
|
| |
- usage = _("usage: %prog remove-host-from-channel [options] <hostname> <channel>")
|
| |
+ usage = "usage: %prog remove-host-from-channel [options] <hostname> <channel>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Please specify a hostname and a channel"))
|
| |
+ parser.error("Please specify a hostname and a channel")
|
| |
host = args[0]
|
| |
activate_session(session, goptions)
|
| |
hostinfo = session.getHost(host)
|
| |
@@ -306,12 +305,12 @@
|
| |
|
| |
def handle_add_channel(goptions, session, args):
|
| |
"[admin] Add a channel"
|
| |
- usage = _("usage: %prog add-channel [options] <channel_name>")
|
| |
+ usage = "usage: %prog add-channel [options] <channel_name>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--description", help=_("Description of channel"))
|
| |
+ parser.add_option("--description", help="Description of channel")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 1:
|
| |
- parser.error(_("Please specify one channel name"))
|
| |
+ parser.error("Please specify one channel name")
|
| |
activate_session(session, goptions)
|
| |
channel_name = args[0]
|
| |
try:
|
| |
@@ -331,12 +330,12 @@
|
| |
|
| |
def handle_remove_channel(goptions, session, args):
|
| |
"[admin] Remove a channel entirely"
|
| |
- usage = _("usage: %prog remove-channel [options] <channel>")
|
| |
+ usage = "usage: %prog remove-channel [options] <channel>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--force", action="store_true", help=_("force removal, if possible"))
|
| |
+ parser.add_option("--force", action="store_true", help="force removal, if possible")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 1:
|
| |
- parser.error(_("Incorrect number of arguments"))
|
| |
+ parser.error("Incorrect number of arguments")
|
| |
activate_session(session, goptions)
|
| |
cinfo = session.getChannel(args[0])
|
| |
if not cinfo:
|
| |
@@ -346,13 +345,13 @@
|
| |
|
| |
def handle_rename_channel(goptions, session, args):
|
| |
"[admin] Rename a channel"
|
| |
- usage = _("usage: %prog rename-channel [options] <old-name> <new-name>")
|
| |
+ usage = "usage: %prog rename-channel [options] <old-name> <new-name>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
print("rename-channel is deprecated and will be removed in 1.28, this call is replaced by "
|
| |
"edit-channel")
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Incorrect number of arguments"))
|
| |
+ parser.error("Incorrect number of arguments")
|
| |
activate_session(session, goptions)
|
| |
cinfo = session.getChannel(args[0])
|
| |
if not cinfo:
|
| |
@@ -362,14 +361,14 @@
|
| |
|
| |
def handle_edit_channel(goptions, session, args):
|
| |
"[admin] Edit a channel"
|
| |
- usage = _("usage: %prog edit-channel [options] <old-name>")
|
| |
+ usage = "usage: %prog edit-channel [options] <old-name>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--name", help=_("New channel name"))
|
| |
- parser.add_option("--description", help=_("Description of channel"))
|
| |
- parser.add_option("--comment", help=_("Comment of channel"))
|
| |
+ parser.add_option("--name", help="New channel name")
|
| |
+ parser.add_option("--description", help="Description of channel")
|
| |
+ parser.add_option("--comment", help="Comment of channel")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 1:
|
| |
- parser.error(_("Incorrect number of arguments"))
|
| |
+ parser.error("Incorrect number of arguments")
|
| |
activate_session(session, goptions)
|
| |
vals = {}
|
| |
for key, val in options.__dict__.items():
|
| |
@@ -389,19 +388,18 @@
|
| |
else:
|
| |
print(msg)
|
| |
if not result:
|
| |
- error(_("No changes made, please correct the command line"))
|
| |
+ error("No changes made, please correct the command line")
|
| |
|
| |
|
| |
def handle_enable_channel(goptions, session, args):
|
| |
"[admin] Mark one or more channels as enabled"
|
| |
- usage = _("usage: %prog enable-channel [options] <channelname> [<channelname> ...]")
|
| |
+ usage = "usage: %prog enable-channel [options] <channelname> [<channelname> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--comment", help=_("Comment indicating why the channel(s) are being "
|
| |
- "enabled"))
|
| |
+ parser.add_option("--comment", help="Comment indicating why the channel(s) are being enabled")
|
| |
(options, args) = parser.parse_args(args)
|
| |
|
| |
if not args:
|
| |
- parser.error(_("At least one channel must be specified"))
|
| |
+ parser.error("At least one channel must be specified")
|
| |
|
| |
activate_session(session, goptions)
|
| |
with session.multicall() as m:
|
| |
@@ -420,14 +418,13 @@
|
| |
|
| |
def handle_disable_channel(goptions, session, args):
|
| |
"[admin] Mark one or more channels as disabled"
|
| |
- usage = _("usage: %prog disable-channel [options] <channelname> [<channelname> ...]")
|
| |
+ usage = "usage: %prog disable-channel [options] <channelname> [<channelname> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--comment", help=_("Comment indicating why the channel(s) are being "
|
| |
- "disabled"))
|
| |
+ parser.add_option("--comment", help="Comment indicating why the channel(s) are being disabled")
|
| |
(options, args) = parser.parse_args(args)
|
| |
|
| |
if not args:
|
| |
- parser.error(_("At least one channel must be specified"))
|
| |
+ parser.error("At least one channel must be specified")
|
| |
|
| |
activate_session(session, goptions)
|
| |
|
| |
@@ -446,16 +443,16 @@
|
| |
|
| |
def handle_add_pkg(goptions, session, args):
|
| |
"[admin] Add a package to the listing for tag"
|
| |
- usage = _("usage: %prog add-pkg [options] --owner <owner> <tag> <package> [<package> ...]")
|
| |
+ usage = "usage: %prog add-pkg [options] --owner <owner> <tag> <package> [<package> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--force", action='store_true', help=_("Override blocks if necessary"))
|
| |
- parser.add_option("--owner", help=_("Specify owner"))
|
| |
- parser.add_option("--extra-arches", help=_("Specify extra arches"))
|
| |
+ parser.add_option("--force", action='store_true', help="Override blocks if necessary")
|
| |
+ parser.add_option("--owner", help="Specify owner")
|
| |
+ parser.add_option("--extra-arches", help="Specify extra arches")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("Please specify a tag and at least one package"))
|
| |
+ parser.error("Please specify a tag and at least one package")
|
| |
if not options.owner:
|
| |
- parser.error(_("Please specify an owner for the package(s)"))
|
| |
+ parser.error("Please specify an owner for the package(s)")
|
| |
if not session.getUser(options.owner):
|
| |
error("No such user: %s" % options.owner)
|
| |
activate_session(session, goptions)
|
| |
@@ -494,13 +491,13 @@
|
| |
|
| |
def handle_block_pkg(goptions, session, args):
|
| |
"[admin] Block a package in the listing for tag"
|
| |
- usage = _("usage: %prog block-pkg [options] <tag> <package> [<package> ...]")
|
| |
+ usage = "usage: %prog block-pkg [options] <tag> <package> [<package> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--force", action='store_true', default=False,
|
| |
- help=_("Override blocks and owner if necessary"))
|
| |
+ help="Override blocks and owner if necessary")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("Please specify a tag and at least one package"))
|
| |
+ parser.error("Please specify a tag and at least one package")
|
| |
activate_session(session, goptions)
|
| |
tag = args[0]
|
| |
# check if list of packages exists for that tag already
|
| |
@@ -534,12 +531,12 @@
|
| |
|
| |
def handle_remove_pkg(goptions, session, args):
|
| |
"[admin] Remove a package from the listing for tag"
|
| |
- usage = _("usage: %prog remove-pkg [options] <tag> <package> [<package> ...]")
|
| |
+ usage = "usage: %prog remove-pkg [options] <tag> <package> [<package> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--force", action='store_true', help=_("Override blocks if necessary"))
|
| |
+ parser.add_option("--force", action='store_true', help="Override blocks if necessary")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("Please specify a tag and at least one package"))
|
| |
+ parser.error("Please specify a tag and at least one package")
|
| |
activate_session(session, goptions)
|
| |
tag = args[0]
|
| |
opts = {}
|
| |
@@ -571,7 +568,7 @@
|
| |
def handle_build(options, session, args):
|
| |
"[build] Build a package from source"
|
| |
|
| |
- usage = _("""\
|
| |
+ usage = """\
|
| |
usage: %prog build [options] <target> <srpm path or scm url>
|
| |
|
| |
The first option is the build target, not to be confused with the destination
|
| |
@@ -580,57 +577,54 @@
|
| |
|
| |
You can list all available build targets using the '%prog list-targets' command.
|
| |
More detail can be found in the documentation.
|
| |
- https://docs.pagure.org/koji/HOWTO/#package-organization""")
|
| |
+ https://docs.pagure.org/koji/HOWTO/#package-organization"""
|
| |
|
| |
usage = textwrap.dedent(usage)
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--skip-tag", action="store_true",
|
| |
- help=_("Do not attempt to tag package"))
|
| |
- parser.add_option("--scratch", action="store_true",
|
| |
- help=_("Perform a scratch build"))
|
| |
+ parser.add_option("--skip-tag", action="store_true", help="Do not attempt to tag package")
|
| |
+ parser.add_option("--scratch", action="store_true", help="Perform a scratch build")
|
| |
parser.add_option("--rebuild-srpm", action="store_true", dest="rebuild_srpm",
|
| |
- help=_("Force rebuilding SRPM for scratch build only"))
|
| |
+ help="Force rebuilding SRPM for scratch build only")
|
| |
parser.add_option("--no-rebuild-srpm", action="store_false", dest="rebuild_srpm",
|
| |
- help=_("Force not to rebuild srpm for scratch build only"))
|
| |
+ help="Force not to rebuild srpm for scratch build only")
|
| |
parser.add_option("--wait", action="store_true",
|
| |
- help=_("Wait on the build, even if running in the background"))
|
| |
- parser.add_option("--nowait", action="store_false", dest="wait",
|
| |
- help=_("Don't wait on build"))
|
| |
+ help="Wait on the build, even if running in the background")
|
| |
+ parser.add_option("--nowait", action="store_false", dest="wait", help="Don't wait on build")
|
| |
parser.add_option("--wait-repo", action="store_true",
|
| |
- help=_("Wait for the actual buildroot repo of given target"))
|
| |
+ help="Wait for the actual buildroot repo of given target")
|
| |
parser.add_option("--wait-build", metavar="NVR", action="append", dest="wait_builds",
|
| |
- default=[], help=_("Wait for the given nvr to appear in buildroot repo"))
|
| |
+ default=[], help="Wait for the given nvr to appear in buildroot repo")
|
| |
parser.add_option("--quiet", action="store_true",
|
| |
- help=_("Do not print the task information"), default=options.quiet)
|
| |
- parser.add_option("--arch-override", help=_("Override build arches"))
|
| |
+ help="Do not print the task information", default=options.quiet)
|
| |
+ parser.add_option("--arch-override", help="Override build arches")
|
| |
parser.add_option("--fail-fast", action="store_true",
|
| |
- help=_("Override build_arch_can_fail settings and fail as fast as possible"))
|
| |
- parser.add_option("--repo-id", type="int", help=_("Use a specific repo"))
|
| |
+ help="Override build_arch_can_fail settings and fail as fast as possible")
|
| |
+ parser.add_option("--repo-id", type="int", help="Use a specific repo")
|
| |
parser.add_option("--noprogress", action="store_true",
|
| |
- help=_("Do not display progress of the upload"))
|
| |
+ help="Do not display progress of the upload")
|
| |
parser.add_option("--background", action="store_true",
|
| |
- help=_("Run the build at a lower priority"))
|
| |
+ help="Run the build at a lower priority")
|
| |
parser.add_option("--custom-user-metadata", type="str",
|
| |
- help=_("Provide a JSON string of custom metadata to be deserialized and "
|
| |
- "stored under the build's extra.custom_user_metadata field"))
|
| |
+ help="Provide a JSON string of custom metadata to be deserialized and "
|
| |
+ "stored under the build's extra.custom_user_metadata field")
|
| |
(build_opts, args) = parser.parse_args(args)
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Exactly two arguments (a build target and a SCM URL or srpm file) are "
|
| |
- "required"))
|
| |
+ parser.error("Exactly two arguments (a build target and a SCM URL or srpm file) are "
|
| |
+ "required")
|
| |
if build_opts.rebuild_srpm is not None and not build_opts.scratch:
|
| |
- parser.error(_("--no-/rebuild-srpm is only allowed for --scratch builds"))
|
| |
+ parser.error("--no-/rebuild-srpm is only allowed for --scratch builds")
|
| |
if build_opts.arch_override and not build_opts.scratch:
|
| |
- parser.error(_("--arch_override is only allowed for --scratch builds"))
|
| |
+ parser.error("--arch_override is only allowed for --scratch builds")
|
| |
custom_user_metadata = {}
|
| |
if build_opts.custom_user_metadata:
|
| |
try:
|
| |
custom_user_metadata = json.loads(build_opts.custom_user_metadata)
|
| |
# Use ValueError instead of json.JSONDecodeError for Python 2 and 3 compatibility
|
| |
except ValueError:
|
| |
- parser.error(_("--custom-user-metadata is not valid JSON"))
|
| |
+ parser.error("--custom-user-metadata is not valid JSON")
|
| |
|
| |
if not isinstance(custom_user_metadata, dict):
|
| |
- parser.error(_("--custom-user-metadata must be a JSON object"))
|
| |
+ parser.error("--custom-user-metadata must be a JSON object")
|
| |
|
| |
activate_session(session, options)
|
| |
target = args[0]
|
| |
@@ -640,12 +634,12 @@
|
| |
else:
|
| |
build_target = session.getBuildTarget(target)
|
| |
if not build_target:
|
| |
- parser.error(_("No such build target: %s") % target)
|
| |
+ parser.error("No such build target: %s" % target)
|
| |
dest_tag = session.getTag(build_target['dest_tag'])
|
| |
if not dest_tag:
|
| |
- parser.error(_("No such destination tag: %s") % build_target['dest_tag_name'])
|
| |
+ parser.error("No such destination tag: %s" % build_target['dest_tag_name'])
|
| |
if dest_tag['locked'] and not build_opts.scratch:
|
| |
- parser.error(_("Destination tag %s is locked") % dest_tag['name'])
|
| |
+ parser.error("Destination tag %s is locked" % dest_tag['name'])
|
| |
source = args[1]
|
| |
opts = {}
|
| |
if build_opts.arch_override:
|
| |
@@ -686,35 +680,35 @@
|
| |
def handle_chain_build(options, session, args):
|
| |
# XXX - replace handle_build with this, once chain-building has gotten testing
|
| |
"[build] Build one or more packages from source"
|
| |
- usage = _("usage: %prog chain-build [options] <target> <URL> [<URL> [:] <URL> [:] <URL> ...]")
|
| |
+ usage = "usage: %prog chain-build [options] <target> <URL> [<URL> [:] <URL> [:] <URL> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--wait", action="store_true",
|
| |
- help=_("Wait on build, even if running in the background"))
|
| |
- parser.add_option("--nowait", action="store_false", dest="wait", help=_("Don't wait on build"))
|
| |
+ help="Wait on build, even if running in the background")
|
| |
+ parser.add_option("--nowait", action="store_false", dest="wait", help="Don't wait on build")
|
| |
parser.add_option("--quiet", action="store_true",
|
| |
- help=_("Do not print the task information"), default=options.quiet)
|
| |
+ help="Do not print the task information", default=options.quiet)
|
| |
parser.add_option("--background", action="store_true",
|
| |
- help=_("Run the build at a lower priority"))
|
| |
+ help="Run the build at a lower priority")
|
| |
(build_opts, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("At least two arguments (a build target and a SCM URL) are required"))
|
| |
+ parser.error("At least two arguments (a build target and a SCM URL) are required")
|
| |
activate_session(session, options)
|
| |
target = args[0]
|
| |
build_target = session.getBuildTarget(target)
|
| |
if not build_target:
|
| |
- parser.error(_("No such build target: %s") % target)
|
| |
+ parser.error("No such build target: %s" % target)
|
| |
dest_tag = session.getTag(build_target['dest_tag'], strict=True)
|
| |
if dest_tag['locked']:
|
| |
- parser.error(_("Destination tag %s is locked") % dest_tag['name'])
|
| |
+ parser.error("Destination tag %s is locked" % dest_tag['name'])
|
| |
|
| |
# check that the destination tag is in the inheritance tree of the build tag
|
| |
# otherwise there is no way that a chain-build can work
|
| |
ancestors = session.getFullInheritance(build_target['build_tag'])
|
| |
if dest_tag['id'] not in [build_target['build_tag']] + \
|
| |
[ancestor['parent_id'] for ancestor in ancestors]:
|
| |
- warn(_("Packages in destination tag %(dest_tag_name)s are not inherited by build tag "
|
| |
- "%(build_tag_name)s" % build_target))
|
| |
- error(_("Target %s is not usable for a chain-build" % build_target['name']))
|
| |
+ warn("Packages in destination tag %(dest_tag_name)s are not inherited by build tag "
|
| |
+ "%(build_tag_name)s" % build_target)
|
| |
+ error("Target %s is not usable for a chain-build" % build_target['name'])
|
| |
sources = args[1:]
|
| |
|
| |
src_list = []
|
| |
@@ -734,13 +728,13 @@
|
| |
# quick check that it looks like a N-V-R
|
| |
build_level.append(src)
|
| |
else:
|
| |
- error(_('"%s" is not a SCM URL or package N-V-R' % src))
|
| |
+ error('"%s" is not a SCM URL or package N-V-R' % src)
|
| |
if build_level:
|
| |
src_list.append(build_level)
|
| |
|
| |
if len(src_list) < 2:
|
| |
- parser.error(_('You must specify at least one dependency between builds with : (colon)\n'
|
| |
- 'If there are no dependencies, use the build command instead'))
|
| |
+ parser.error('You must specify at least one dependency between builds with : (colon)\n'
|
| |
+ 'If there are no dependencies, use the build command instead')
|
| |
|
| |
priority = None
|
| |
if build_opts.background:
|
| |
@@ -759,70 +753,58 @@
|
| |
|
| |
def handle_maven_build(options, session, args):
|
| |
"[build] Build a Maven package from source"
|
| |
- usage = _("usage: %prog maven-build [options] <target> <URL>")
|
| |
- usage += _("\n %prog maven-build --ini=CONFIG... [options] <target>")
|
| |
+ usage = "usage: %prog maven-build [options] <target> <URL>"
|
| |
+ usage += "\n %prog maven-build --ini=CONFIG... [options] <target>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--patches", action="store", metavar="URL",
|
| |
- help=_("SCM URL of a directory containing patches to apply to the sources "
|
| |
- "before building"))
|
| |
- parser.add_option("-G", "--goal", action="append",
|
| |
- dest="goals", metavar="GOAL", default=[],
|
| |
- help=_("Additional goal to run before \"deploy\""))
|
| |
- parser.add_option("-P", "--profile", action="append",
|
| |
- dest="profiles", metavar="PROFILE", default=[],
|
| |
- help=_("Enable a profile for the Maven build"))
|
| |
- parser.add_option("-D", "--property", action="append",
|
| |
- dest="properties", metavar="NAME=VALUE", default=[],
|
| |
- help=_("Pass a system property to the Maven build"))
|
| |
- parser.add_option("-E", "--env", action="append",
|
| |
- dest="envs", metavar="NAME=VALUE", default=[],
|
| |
- help=_("Set an environment variable"))
|
| |
- parser.add_option("-p", "--package", action="append",
|
| |
- dest="packages", metavar="PACKAGE", default=[],
|
| |
- help=_("Install an additional package into the buildroot"))
|
| |
- parser.add_option("-J", "--jvm-option", action="append",
|
| |
- dest="jvm_options", metavar="OPTION", default=[],
|
| |
- help=_("Pass a command-line option to the JVM"))
|
| |
- parser.add_option("-M", "--maven-option", action="append",
|
| |
- dest="maven_options", metavar="OPTION", default=[],
|
| |
- help=_("Pass a command-line option to Maven"))
|
| |
- parser.add_option("--ini", action="append",
|
| |
- dest="inis", metavar="CONFIG", default=[],
|
| |
- help=_("Pass build parameters via a .ini file"))
|
| |
- parser.add_option("-s", "--section",
|
| |
- help=_("Get build parameters from this section of the .ini"))
|
| |
- parser.add_option("--debug", action="store_true",
|
| |
- help=_("Run Maven build in debug mode"))
|
| |
+ help="SCM URL of a directory containing patches to apply to the sources "
|
| |
+ "before building")
|
| |
+ parser.add_option("-G", "--goal", action="append", dest="goals", metavar="GOAL", default=[],
|
| |
+ help="Additional goal to run before \"deploy\"")
|
| |
+ parser.add_option("-P", "--profile", action="append", dest="profiles", metavar="PROFILE",
|
| |
+ default=[], help="Enable a profile for the Maven build")
|
| |
+ parser.add_option("-D", "--property", action="append", dest="properties", metavar="NAME=VALUE",
|
| |
+ default=[], help="Pass a system property to the Maven build")
|
| |
+ parser.add_option("-E", "--env", action="append", dest="envs", metavar="NAME=VALUE",
|
| |
+ default=[], help="Set an environment variable")
|
| |
+ parser.add_option("-p", "--package", action="append", dest="packages", metavar="PACKAGE",
|
| |
+ default=[], help="Install an additional package into the buildroot")
|
| |
+ parser.add_option("-J", "--jvm-option", action="append", dest="jvm_options", metavar="OPTION",
|
| |
+ default=[], help="Pass a command-line option to the JVM")
|
| |
+ parser.add_option("-M", "--maven-option", action="append", dest="maven_options",
|
| |
+ metavar="OPTION", default=[], help="Pass a command-line option to Maven")
|
| |
+ parser.add_option("--ini", action="append", dest="inis", metavar="CONFIG", default=[],
|
| |
+ help="Pass build parameters via a .ini file")
|
| |
+ parser.add_option("-s", "--section", help="Get build parameters from this section of the .ini")
|
| |
+ parser.add_option("--debug", action="store_true", help="Run Maven build in debug mode")
|
| |
parser.add_option("--specfile", action="store", metavar="URL",
|
| |
- help=_("SCM URL of a spec file fragment to use to generate wrapper RPMs"))
|
| |
- parser.add_option("--skip-tag", action="store_true",
|
| |
- help=_("Do not attempt to tag package"))
|
| |
- parser.add_option("--scratch", action="store_true",
|
| |
- help=_("Perform a scratch build"))
|
| |
+ help="SCM URL of a spec file fragment to use to generate wrapper RPMs")
|
| |
+ parser.add_option("--skip-tag", action="store_true", help="Do not attempt to tag package")
|
| |
+ parser.add_option("--scratch", action="store_true", help="Perform a scratch build")
|
| |
parser.add_option("--wait", action="store_true",
|
| |
- help=_("Wait on build, even if running in the background"))
|
| |
- parser.add_option("--nowait", action="store_false", dest="wait", help=_("Don't wait on build"))
|
| |
+ help="Wait on build, even if running in the background")
|
| |
+ parser.add_option("--nowait", action="store_false", dest="wait", help="Don't wait on build")
|
| |
parser.add_option("--quiet", action="store_true",
|
| |
- help=_("Do not print the task information"), default=options.quiet)
|
| |
+ help="Do not print the task information", default=options.quiet)
|
| |
parser.add_option("--background", action="store_true",
|
| |
- help=_("Run the build at a lower priority"))
|
| |
+ help="Run the build at a lower priority")
|
| |
(build_opts, args) = parser.parse_args(args)
|
| |
if build_opts.inis:
|
| |
if len(args) != 1:
|
| |
- parser.error(_("Exactly one argument (a build target) is required"))
|
| |
+ parser.error("Exactly one argument (a build target) is required")
|
| |
else:
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Exactly two arguments (a build target and a SCM URL) are required"))
|
| |
+ parser.error("Exactly two arguments (a build target and a SCM URL) are required")
|
| |
activate_session(session, options)
|
| |
target = args[0]
|
| |
build_target = session.getBuildTarget(target)
|
| |
if not build_target:
|
| |
- parser.error(_("No such build target: %s") % target)
|
| |
+ parser.error("No such build target: %s" % target)
|
| |
dest_tag = session.getTag(build_target['dest_tag'])
|
| |
if not dest_tag:
|
| |
- parser.error(_("No such destination tag: %s") % build_target['dest_tag_name'])
|
| |
+ parser.error("No such destination tag: %s" % build_target['dest_tag_name'])
|
| |
if dest_tag['locked'] and not build_opts.scratch:
|
| |
- parser.error(_("Destination tag %s is locked") % dest_tag['name'])
|
| |
+ parser.error("Destination tag %s is locked" % dest_tag['name'])
|
| |
if build_opts.inis:
|
| |
try:
|
| |
params = koji.util.parse_maven_param(build_opts.inis, scratch=build_opts.scratch,
|
| |
@@ -831,14 +813,14 @@
|
| |
parser.error(e.args[0])
|
| |
opts = to_list(params.values())[0]
|
| |
if opts.pop('type', 'maven') != 'maven':
|
| |
- parser.error(_("Section %s does not contain a maven-build config") %
|
| |
+ parser.error("Section %s does not contain a maven-build config" %
|
| |
to_list(params.keys())[0])
|
| |
source = opts.pop('scmurl')
|
| |
else:
|
| |
source = args[1]
|
| |
opts = koji.util.maven_opts(build_opts, scratch=build_opts.scratch)
|
| |
if '://' not in source:
|
| |
- parser.error(_("No such SCM URL: %s") % source)
|
| |
+ parser.error("No such SCM URL: %s" % source)
|
| |
if build_opts.debug:
|
| |
opts.setdefault('maven_options', []).append('--debug')
|
| |
if build_opts.skip_tag:
|
| |
@@ -859,32 +841,31 @@
|
| |
|
| |
def handle_wrapper_rpm(options, session, args):
|
| |
"""[build] Build wrapper rpms for any archives associated with a build."""
|
| |
- usage = _("usage: %prog wrapper-rpm [options] <target> <build-id|n-v-r> <URL>")
|
| |
+ usage = "usage: %prog wrapper-rpm [options] <target> <build-id|n-v-r> <URL>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--create-build", action="store_true",
|
| |
- help=_("Create a new build to contain wrapper rpms"))
|
| |
- parser.add_option("--ini", action="append",
|
| |
- dest="inis", metavar="CONFIG", default=[],
|
| |
- help=_("Pass build parameters via a .ini file"))
|
| |
+ help="Create a new build to contain wrapper rpms")
|
| |
+ parser.add_option("--ini", action="append", dest="inis", metavar="CONFIG", default=[],
|
| |
+ help="Pass build parameters via a .ini file")
|
| |
parser.add_option("-s", "--section",
|
| |
- help=_("Get build parameters from this section of the .ini"))
|
| |
+ help="Get build parameters from this section of the .ini")
|
| |
parser.add_option("--skip-tag", action="store_true",
|
| |
- help=_("If creating a new build, don't tag it"))
|
| |
- parser.add_option("--scratch", action="store_true", help=_("Perform a scratch build"))
|
| |
+ help="If creating a new build, don't tag it")
|
| |
+ parser.add_option("--scratch", action="store_true", help="Perform a scratch build")
|
| |
parser.add_option("--wait", action="store_true",
|
| |
- help=_("Wait on build, even if running in the background"))
|
| |
- parser.add_option("--nowait", action="store_false", dest="wait", help=_("Don't wait on build"))
|
| |
+ help="Wait on build, even if running in the background")
|
| |
+ parser.add_option("--nowait", action="store_false", dest="wait", help="Don't wait on build")
|
| |
parser.add_option("--background", action="store_true",
|
| |
- help=_("Run the build at a lower priority"))
|
| |
+ help="Run the build at a lower priority")
|
| |
|
| |
(build_opts, args) = parser.parse_args(args)
|
| |
if build_opts.inis:
|
| |
if len(args) != 1:
|
| |
- parser.error(_("Exactly one argument (a build target) is required"))
|
| |
+ parser.error("Exactly one argument (a build target) is required")
|
| |
else:
|
| |
if len(args) < 3:
|
| |
- parser.error(_("You must provide a build target, a build ID or NVR, "
|
| |
- "and a SCM URL to a specfile fragment"))
|
| |
+ parser.error("You must provide a build target, a build ID or NVR, "
|
| |
+ "and a SCM URL to a specfile fragment")
|
| |
activate_session(session, options)
|
| |
|
| |
target = args[0]
|
| |
@@ -896,14 +877,14 @@
|
| |
parser.error(e.args[0])
|
| |
opts = to_list(params.values())[0]
|
| |
if opts.get('type') != 'wrapper':
|
| |
- parser.error(_("Section %s does not contain a wrapper-rpm config") %
|
| |
+ parser.error("Section %s does not contain a wrapper-rpm config" %
|
| |
to_list(params.keys())[0])
|
| |
url = opts['scmurl']
|
| |
package = opts['buildrequires'][0]
|
| |
target_info = session.getBuildTarget(target, strict=True)
|
| |
latest_builds = session.getLatestBuilds(target_info['dest_tag'], package=package)
|
| |
if not latest_builds:
|
| |
- parser.error(_("No build of %s in %s") % (package, target_info['dest_tag_name']))
|
| |
+ parser.error("No build of %s in %s" % (package, target_info['dest_tag_name']))
|
| |
build_id = latest_builds[0]['nvr']
|
| |
else:
|
| |
build_id = args[1]
|
| |
@@ -931,34 +912,30 @@
|
| |
|
| |
def handle_maven_chain(options, session, args):
|
| |
"[build] Run a set of Maven builds in dependency order"
|
| |
- usage = _("usage: %prog maven-chain [options] <target> <config> [<config> ...]")
|
| |
+ usage = "usage: %prog maven-chain [options] <target> <config> [<config> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--skip-tag", action="store_true",
|
| |
- help=_("Do not attempt to tag builds"))
|
| |
- parser.add_option("--scratch", action="store_true",
|
| |
- help=_("Perform scratch builds"))
|
| |
- parser.add_option("--debug", action="store_true",
|
| |
- help=_("Run Maven build in debug mode"))
|
| |
- parser.add_option("--force", action="store_true",
|
| |
- help=_("Force rebuilds of all packages"))
|
| |
+ parser.add_option("--skip-tag", action="store_true", help="Do not attempt to tag builds")
|
| |
+ parser.add_option("--scratch", action="store_true", help="Perform scratch builds")
|
| |
+ parser.add_option("--debug", action="store_true", help="Run Maven build in debug mode")
|
| |
+ parser.add_option("--force", action="store_true", help="Force rebuilds of all packages")
|
| |
parser.add_option("--wait", action="store_true",
|
| |
- help=_("Wait on build, even if running in the background"))
|
| |
- parser.add_option("--nowait", action="store_false", dest="wait", help=_("Don't wait on build"))
|
| |
+ help="Wait on build, even if running in the background")
|
| |
+ parser.add_option("--nowait", action="store_false", dest="wait", help="Don't wait on build")
|
| |
parser.add_option("--background", action="store_true",
|
| |
- help=_("Run the build at a lower priority"))
|
| |
+ help="Run the build at a lower priority")
|
| |
(build_opts, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("Two arguments (a build target and a config file) are required"))
|
| |
+ parser.error("Two arguments (a build target and a config file) are required")
|
| |
activate_session(session, options)
|
| |
target = args[0]
|
| |
build_target = session.getBuildTarget(target)
|
| |
if not build_target:
|
| |
- parser.error(_("No such build target: %s") % target)
|
| |
+ parser.error("No such build target: %s" % target)
|
| |
dest_tag = session.getTag(build_target['dest_tag'])
|
| |
if not dest_tag:
|
| |
- parser.error(_("No such destination tag: %s") % build_target['dest_tag_name'])
|
| |
+ parser.error("No such destination tag: %s" % build_target['dest_tag_name'])
|
| |
if dest_tag['locked'] and not build_opts.scratch:
|
| |
- parser.error(_("Destination tag %s is locked") % dest_tag['name'])
|
| |
+ parser.error("Destination tag %s is locked" % dest_tag['name'])
|
| |
opts = {}
|
| |
for key in ('skip_tag', 'scratch', 'debug', 'force'):
|
| |
val = getattr(build_opts, key)
|
| |
@@ -982,18 +959,18 @@
|
| |
|
| |
def handle_resubmit(goptions, session, args):
|
| |
"""[build] Retry a canceled or failed task, using the same parameter as the original task."""
|
| |
- usage = _("usage: %prog resubmit [options] <task_id>")
|
| |
+ usage = "usage: %prog resubmit [options] <task_id>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--wait", action="store_true",
|
| |
- help=_("Wait on task, even if running in the background"))
|
| |
- parser.add_option("--nowait", action="store_false", dest="wait", help=_("Don't wait on task"))
|
| |
+ help="Wait on task, even if running in the background")
|
| |
+ parser.add_option("--nowait", action="store_false", dest="wait", help="Don't wait on task")
|
| |
parser.add_option("--nowatch", action="store_true", dest="nowait",
|
| |
- help=_("An alias for --nowait"))
|
| |
+ help="An alias for --nowait")
|
| |
parser.add_option("--quiet", action="store_true", default=goptions.quiet,
|
| |
- help=_("Do not print the task information"))
|
| |
+ help="Do not print the task information")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 1:
|
| |
- parser.error(_("Please specify a single task ID"))
|
| |
+ parser.error("Please specify a single task ID")
|
| |
activate_session(session, goptions)
|
| |
taskID = int(args[0])
|
| |
if not options.quiet:
|
| |
@@ -1010,25 +987,25 @@
|
| |
|
| |
def handle_call(goptions, session, args):
|
| |
"Execute an arbitrary XML-RPC call"
|
| |
- usage = _("""\
|
| |
+ usage = """\
|
| |
usage: %prog call [options] <name> [<arg> ...]
|
| |
|
| |
- Note, that you can use global option --noauth for anonymous calls here""")
|
| |
+ Note, that you can use global option --noauth for anonymous calls here"""
|
| |
usage = textwrap.dedent(usage)
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--python", action="store_true", help=_("Use python syntax for values"))
|
| |
+ parser.add_option("--python", action="store_true", help="Use python syntax for values")
|
| |
parser.add_option("--kwargs",
|
| |
- help=_("Specify keyword arguments as a dictionary (implies --python)"))
|
| |
- parser.add_option("--json-output", action="store_true", help=_("Use JSON syntax for output"))
|
| |
+ help="Specify keyword arguments as a dictionary (implies --python)")
|
| |
+ parser.add_option("--json-output", action="store_true", help="Use JSON syntax for output")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("Please specify the name of the XML-RPC method"))
|
| |
+ parser.error("Please specify the name of the XML-RPC method")
|
| |
if options.kwargs:
|
| |
options.python = True
|
| |
if options.python and ast is None:
|
| |
- parser.error(_("The ast module is required to read python syntax"))
|
| |
+ parser.error("The ast module is required to read python syntax")
|
| |
if options.json_output and json is None:
|
| |
- parser.error(_("The json module is required to output JSON syntax"))
|
| |
+ parser.error("The json module is required to output JSON syntax")
|
| |
activate_session(session, goptions)
|
| |
name = args[0]
|
| |
non_kw = []
|
| |
@@ -1053,26 +1030,24 @@
|
| |
|
| |
def anon_handle_mock_config(goptions, session, args):
|
| |
"[info] Create a mock config"
|
| |
- usage = _("usage: %prog mock-config [options]")
|
| |
+ usage = "usage: %prog mock-config [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("-a", "--arch", help=_("Specify the arch"))
|
| |
- parser.add_option("-n", "--name", help=_("Specify the name for the buildroot"))
|
| |
- parser.add_option("--tag", help=_("Create a mock config for a tag"))
|
| |
- parser.add_option("--target", help=_("Create a mock config for a build target"))
|
| |
- parser.add_option("--task", help=_("Duplicate the mock config of a previous task"))
|
| |
- parser.add_option("--latest", action="store_true", help=_("use the latest redirect url"))
|
| |
+ parser.add_option("-a", "--arch", help="Specify the arch")
|
| |
+ parser.add_option("-n", "--name", help="Specify the name for the buildroot")
|
| |
+ parser.add_option("--tag", help="Create a mock config for a tag")
|
| |
+ parser.add_option("--target", help="Create a mock config for a build target")
|
| |
+ parser.add_option("--task", help="Duplicate the mock config of a previous task")
|
| |
+ parser.add_option("--latest", action="store_true", help="use the latest redirect url")
|
| |
parser.add_option("--buildroot",
|
| |
- help=_("Duplicate the mock config for the specified buildroot id"))
|
| |
- parser.add_option("--mockdir", default="/var/lib/mock", metavar="DIR",
|
| |
- help=_("Specify mockdir"))
|
| |
- parser.add_option("--topdir", metavar="DIR",
|
| |
- help=_("Specify topdir"))
|
| |
+ help="Duplicate the mock config for the specified buildroot id")
|
| |
+ parser.add_option("--mockdir", default="/var/lib/mock", metavar="DIR", help="Specify mockdir")
|
| |
+ parser.add_option("--topdir", metavar="DIR", help="Specify topdir")
|
| |
parser.add_option("--topurl", metavar="URL", default=goptions.topurl,
|
| |
- help=_("URL under which Koji files are accessible"))
|
| |
+ help="URL under which Koji files are accessible")
|
| |
parser.add_option("--distribution", default="Koji Testing",
|
| |
- help=_("Change the distribution macro"))
|
| |
- parser.add_option("--yum-proxy", help=_("Specify a yum proxy"))
|
| |
- parser.add_option("-o", metavar="FILE", dest="ofile", help=_("Output to a file"))
|
| |
+ help="Change the distribution macro")
|
| |
+ parser.add_option("--yum-proxy", help="Specify a yum proxy")
|
| |
+ parser.add_option("-o", metavar="FILE", dest="ofile", help="Output to a file")
|
| |
(options, args) = parser.parse_args(args)
|
| |
ensure_connection(session, goptions)
|
| |
if args:
|
| |
@@ -1080,7 +1055,7 @@
|
| |
if not options.name:
|
| |
options.name = args[0]
|
| |
else:
|
| |
- parser.error(_("Name already specified via option"))
|
| |
+ parser.error("Name already specified via option")
|
| |
arch = None
|
| |
opts = {}
|
| |
for k in ('topdir', 'topurl', 'distribution', 'mockdir', 'yum_proxy'):
|
| |
@@ -1090,10 +1065,10 @@
|
| |
try:
|
| |
br_id = int(options.buildroot)
|
| |
except ValueError:
|
| |
- parser.error(_("Buildroot id must be an integer"))
|
| |
+ parser.error("Buildroot id must be an integer")
|
| |
brootinfo = session.getBuildroot(br_id)
|
| |
if brootinfo is None:
|
| |
- error(_("No such buildroot: %r") % br_id)
|
| |
+ error("No such buildroot: %r" % br_id)
|
| |
if options.latest:
|
| |
opts['repoid'] = 'latest'
|
| |
else:
|
| |
@@ -1104,12 +1079,12 @@
|
| |
try:
|
| |
task_id = int(options.task)
|
| |
except ValueError:
|
| |
- parser.error(_("Task id must be an integer"))
|
| |
+ parser.error("Task id must be an integer")
|
| |
broots = session.listBuildroots(taskID=task_id)
|
| |
if not broots:
|
| |
- error(_("No buildroots for task %s (or no such task)") % options.task)
|
| |
+ error("No buildroots for task %s (or no such task)" % options.task)
|
| |
if len(broots) > 1:
|
| |
- print(_("Multiple buildroots found: %s" % [br['id'] for br in broots]))
|
| |
+ print("Multiple buildroots found: %s" % [br['id'] for br in broots])
|
| |
brootinfo = broots[-1]
|
| |
if options.latest:
|
| |
opts['repoid'] = 'latest'
|
| |
@@ -1121,39 +1096,39 @@
|
| |
options.name = "%s-task_%i" % (opts['tag_name'], task_id)
|
| |
elif options.tag:
|
| |
if not options.arch:
|
| |
- error(_("Please specify an arch"))
|
| |
+ error("Please specify an arch")
|
| |
tag = session.getTag(options.tag)
|
| |
if not tag:
|
| |
- parser.error(_("No such tag: %s") % options.tag)
|
| |
+ parser.error("No such tag: %s" % options.tag)
|
| |
arch = options.arch
|
| |
config = session.getBuildConfig(tag['id'])
|
| |
if not config:
|
| |
- error(_("Could not get config info for tag: %(name)s") % tag)
|
| |
+ error("Could not get config info for tag: %(name)s" % tag)
|
| |
opts['tag_name'] = tag['name']
|
| |
if options.latest:
|
| |
opts['repoid'] = 'latest'
|
| |
else:
|
| |
repo = session.getRepo(config['id'])
|
| |
if not repo:
|
| |
- error(_("Could not get a repo for tag: %(name)s") % tag)
|
| |
+ error("Could not get a repo for tag: %(name)s" % tag)
|
| |
opts['repoid'] = repo['id']
|
| |
elif options.target:
|
| |
if not options.arch:
|
| |
- error(_("Please specify an arch"))
|
| |
+ error("Please specify an arch")
|
| |
arch = options.arch
|
| |
target = session.getBuildTarget(options.target)
|
| |
if not target:
|
| |
- parser.error(_("No such build target: %s") % options.target)
|
| |
+ parser.error("No such build target: %s" % options.target)
|
| |
opts['tag_name'] = target['build_tag_name']
|
| |
if options.latest:
|
| |
opts['repoid'] = 'latest'
|
| |
else:
|
| |
repo = session.getRepo(target['build_tag'])
|
| |
if not repo:
|
| |
- error(_("Could not get a repo for tag: %s") % opts['tag_name'])
|
| |
+ error("Could not get a repo for tag: %s" % opts['tag_name'])
|
| |
opts['repoid'] = repo['id']
|
| |
else:
|
| |
- parser.error(_("Please specify one of: --tag, --target, --task, --buildroot"))
|
| |
+ parser.error("Please specify one of: --tag, --target, --task, --buildroot")
|
| |
if options.name:
|
| |
name = options.name
|
| |
else:
|
| |
@@ -1194,13 +1169,13 @@
|
| |
|
| |
def handle_disable_host(goptions, session, args):
|
| |
"[admin] Mark one or more hosts as disabled"
|
| |
- usage = _("usage: %prog disable-host [options] <hostname> [<hostname> ...]")
|
| |
+ usage = "usage: %prog disable-host [options] <hostname> [<hostname> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--comment", help=_("Comment indicating why the host(s) are being disabled"))
|
| |
+ parser.add_option("--comment", help="Comment indicating why the host(s) are being disabled")
|
| |
(options, args) = parser.parse_args(args)
|
| |
|
| |
if not args:
|
| |
- parser.error(_("At least one host must be specified"))
|
| |
+ parser.error("At least one host must be specified")
|
| |
|
| |
activate_session(session, goptions)
|
| |
session.multicall = True
|
| |
@@ -1223,13 +1198,13 @@
|
| |
|
| |
def handle_enable_host(goptions, session, args):
|
| |
"[admin] Mark one or more hosts as enabled"
|
| |
- usage = _("usage: %prog enable-host [options] <hostname> [<hostname> ...]")
|
| |
+ usage = "usage: %prog enable-host [options] <hostname> [<hostname> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--comment", help=_("Comment indicating why the host(s) are being enabled"))
|
| |
+ parser.add_option("--comment", help="Comment indicating why the host(s) are being enabled")
|
| |
(options, args) = parser.parse_args(args)
|
| |
|
| |
if not args:
|
| |
- parser.error(_("At least one host must be specified"))
|
| |
+ parser.error("At least one host must be specified")
|
| |
|
| |
activate_session(session, goptions)
|
| |
session.multicall = True
|
| |
@@ -1252,26 +1227,22 @@
|
| |
|
| |
def handle_restart_hosts(options, session, args):
|
| |
"[admin] Restart enabled hosts"
|
| |
- usage = _("usage: %prog restart-hosts [options]")
|
| |
+ usage = "usage: %prog restart-hosts [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--wait", action="store_true",
|
| |
- help=_("Wait on the task, even if running in the background"))
|
| |
- parser.add_option("--nowait", action="store_false", dest="wait",
|
| |
- help=_("Don't wait on task"))
|
| |
+ help="Wait on the task, even if running in the background")
|
| |
+ parser.add_option("--nowait", action="store_false", dest="wait", help="Don't wait on task")
|
| |
parser.add_option("--quiet", action="store_true",
|
| |
- help=_("Do not print the task information"), default=options.quiet)
|
| |
- parser.add_option("--force", action="store_true",
|
| |
- help=_("Ignore checks and force operation"))
|
| |
- parser.add_option("--channel", help=_("Only hosts in this channel"))
|
| |
+ help="Do not print the task information", default=options.quiet)
|
| |
+ parser.add_option("--force", action="store_true", help="Ignore checks and force operation")
|
| |
+ parser.add_option("--channel", help="Only hosts in this channel")
|
| |
parser.add_option("--arch", "-a", action="append", default=[],
|
| |
- help=_("Limit to hosts of this architecture (can be "
|
| |
- "given multiple times)"))
|
| |
- parser.add_option("--timeout", metavar='N', type='int',
|
| |
- help=_("Time out after N seconds"))
|
| |
+ help="Limit to hosts of this architecture (can be given multiple times)")
|
| |
+ parser.add_option("--timeout", metavar='N', type='int', help="Time out after N seconds")
|
| |
(my_opts, args) = parser.parse_args(args)
|
| |
|
| |
if len(args) > 0:
|
| |
- parser.error(_("restart-hosts does not accept arguments"))
|
| |
+ parser.error("restart-hosts does not accept arguments")
|
| |
|
| |
activate_session(session, options)
|
| |
|
| |
@@ -1308,24 +1279,23 @@
|
| |
|
| |
def handle_import(goptions, session, args):
|
| |
"[admin] Import externally built RPMs into the database"
|
| |
- usage = _("usage: %prog import [options] <package> [<package> ...]")
|
| |
+ usage = "usage: %prog import [options] <package> [<package> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--link", action="store_true",
|
| |
- help=_("Attempt to hardlink instead of uploading"))
|
| |
- parser.add_option("--test", action="store_true", help=_("Don't actually import"))
|
| |
- parser.add_option("--create-build", action="store_true",
|
| |
- help=_("Auto-create builds as needed"))
|
| |
- parser.add_option("--src-epoch", help=_("When auto-creating builds, use this epoch"))
|
| |
+ help="Attempt to hardlink instead of uploading")
|
| |
+ parser.add_option("--test", action="store_true", help="Don't actually import")
|
| |
+ parser.add_option("--create-build", action="store_true", help="Auto-create builds as needed")
|
| |
+ parser.add_option("--src-epoch", help="When auto-creating builds, use this epoch")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("At least one package must be specified"))
|
| |
+ parser.error("At least one package must be specified")
|
| |
if options.src_epoch in ('None', 'none', '(none)'):
|
| |
options.src_epoch = None
|
| |
elif options.src_epoch:
|
| |
try:
|
| |
options.src_epoch = int(options.src_epoch)
|
| |
except (ValueError, TypeError):
|
| |
- parser.error(_("Invalid value for epoch: %s") % options.src_epoch)
|
| |
+ parser.error("Invalid value for epoch: %s" % options.src_epoch)
|
| |
activate_session(session, goptions)
|
| |
to_import = {}
|
| |
for path in args:
|
| |
@@ -1348,10 +1318,10 @@
|
| |
# no srpm included, check for build
|
| |
binfo = session.getBuild(nvr)
|
| |
if not binfo:
|
| |
- print(_("Missing build or srpm: %s") % nvr)
|
| |
+ print("Missing build or srpm: %s" % nvr)
|
| |
builds_missing = True
|
| |
if builds_missing and not options.create_build:
|
| |
- print(_("Aborting import"))
|
| |
+ print("Aborting import")
|
| |
return
|
| |
|
| |
# local function to help us out below
|
| |
@@ -1360,35 +1330,35 @@
|
| |
prev = session.getRPM(rinfo)
|
| |
if prev and not prev.get('external_repo_id', 0):
|
| |
if prev['payloadhash'] == koji.hex_string(data['sigmd5']):
|
| |
- print(_("RPM already imported: %s") % path)
|
| |
+ print("RPM already imported: %s" % path)
|
| |
else:
|
| |
warn("md5sum mismatch for %s" % path)
|
| |
warn(" A different rpm with the same name has already been imported")
|
| |
warn(" Existing sigmd5 is %r, your import has %r" % (
|
| |
prev['payloadhash'], koji.hex_string(data['sigmd5'])))
|
| |
- print(_("Skipping import"))
|
| |
+ print("Skipping import")
|
| |
return
|
| |
if options.test:
|
| |
- print(_("Test mode -- skipping import for %s") % path)
|
| |
+ print("Test mode -- skipping import for %s" % path)
|
| |
return
|
| |
serverdir = unique_path('cli-import')
|
| |
if options.link:
|
| |
linked_upload(path, serverdir)
|
| |
else:
|
| |
- sys.stdout.write(_("uploading %s... ") % path)
|
| |
+ sys.stdout.write("uploading %s... " % path)
|
| |
sys.stdout.flush()
|
| |
session.uploadWrapper(path, serverdir)
|
| |
- print(_("done"))
|
| |
+ print("done")
|
| |
sys.stdout.flush()
|
| |
- sys.stdout.write(_("importing %s... ") % path)
|
| |
+ sys.stdout.write("importing %s... " % path)
|
| |
sys.stdout.flush()
|
| |
try:
|
| |
session.importRPM(serverdir, os.path.basename(path))
|
| |
except koji.GenericError as e:
|
| |
- print(_("\nError importing: %s" % str(e).splitlines()[-1]))
|
| |
+ print("\nError importing: %s" % str(e).splitlines()[-1])
|
| |
sys.stdout.flush()
|
| |
else:
|
| |
- print(_("done"))
|
| |
+ print("done")
|
| |
sys.stdout.flush()
|
| |
|
| |
for nvr in nvrs:
|
| |
@@ -1401,10 +1371,10 @@
|
| |
need_build = False
|
| |
elif b_state in ['FAILED', 'CANCELED']:
|
| |
if not options.create_build:
|
| |
- print(_("Build %s state is %s. Skipping import") % (nvr, b_state))
|
| |
+ print("Build %s state is %s. Skipping import" % (nvr, b_state))
|
| |
continue
|
| |
else:
|
| |
- print(_("Build %s exists with state=%s. Skipping import") % (nvr, b_state))
|
| |
+ print("Build %s exists with state=%s. Skipping import" % (nvr, b_state))
|
| |
continue
|
| |
|
| |
# import srpms first, if any
|
| |
@@ -1412,7 +1382,7 @@
|
| |
if data['sourcepackage']:
|
| |
if binfo and b_state != 'COMPLETE':
|
| |
# need to fix the state
|
| |
- print(_("Creating empty build: %s") % nvr)
|
| |
+ print("Creating empty build: %s" % nvr)
|
| |
b_data = koji.util.dslice(binfo, ['name', 'version', 'release'])
|
| |
b_data['epoch'] = data['epoch']
|
| |
session.createEmptyBuild(**b_data)
|
| |
@@ -1426,11 +1396,11 @@
|
| |
if binfo:
|
| |
# should have caught this earlier, but just in case...
|
| |
b_state = koji.BUILD_STATES[binfo['state']]
|
| |
- print(_("Build %s state is %s. Skipping import") % (nvr, b_state))
|
| |
+ print("Build %s state is %s. Skipping import" % (nvr, b_state))
|
| |
continue
|
| |
else:
|
| |
- print(_("No such build: %s (include matching srpm or use "
|
| |
- "--create-build option to add it)") % nvr)
|
| |
+ print("No such build: %s (include matching srpm or use "
|
| |
+ "--create-build option to add it)" % nvr)
|
| |
continue
|
| |
else:
|
| |
# let's make a new build
|
| |
@@ -1442,9 +1412,9 @@
|
| |
data = to_import[nvr][0][1]
|
| |
b_data['epoch'] = data['epoch']
|
| |
if options.test:
|
| |
- print(_("Test mode -- would have created empty build: %s") % nvr)
|
| |
+ print("Test mode -- would have created empty build: %s" % nvr)
|
| |
else:
|
| |
- print(_("Creating empty build: %s") % nvr)
|
| |
+ print("Creating empty build: %s" % nvr)
|
| |
session.createEmptyBuild(**b_data)
|
| |
binfo = session.getBuild(nvr)
|
| |
|
| |
@@ -1456,23 +1426,23 @@
|
| |
|
| |
def handle_import_cg(goptions, session, args):
|
| |
"[admin] Import external builds with rich metadata"
|
| |
- usage = _("usage: %prog import-cg [options] <metadata_file> <files_dir>")
|
| |
+ usage = "usage: %prog import-cg [options] <metadata_file> <files_dir>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--noprogress", action="store_true",
|
| |
- help=_("Do not display progress of the upload"))
|
| |
+ help="Do not display progress of the upload")
|
| |
parser.add_option("--link", action="store_true",
|
| |
- help=_("Attempt to hardlink instead of uploading"))
|
| |
- parser.add_option("--test", action="store_true", help=_("Don't actually import"))
|
| |
- parser.add_option("--token", action="store", default=None, help=_("Build reservation token"))
|
| |
+ help="Attempt to hardlink instead of uploading")
|
| |
+ parser.add_option("--test", action="store_true", help="Don't actually import")
|
| |
+ parser.add_option("--token", action="store", default=None, help="Build reservation token")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("Please specify metadata files directory"))
|
| |
+ parser.error("Please specify metadata files directory")
|
| |
if json is None:
|
| |
- parser.error(_("Unable to find json module"))
|
| |
+ parser.error("Unable to find json module")
|
| |
activate_session(session, goptions)
|
| |
metadata = koji.load_json(args[0])
|
| |
if 'output' not in metadata:
|
| |
- print(_("Metadata contains no output"))
|
| |
+ print("Metadata contains no output")
|
| |
sys.exit(1)
|
| |
localdir = args[1]
|
| |
|
| |
@@ -1482,7 +1452,7 @@
|
| |
continue
|
| |
localpath = os.path.join(localdir, info.get('relpath', ''), info['filename'])
|
| |
if not os.path.exists(localpath):
|
| |
- parser.error(_("No such file: %s") % localpath)
|
| |
+ parser.error("No such file: %s" % localpath)
|
| |
to_upload.append([localpath, info])
|
| |
|
| |
if options.test:
|
| |
@@ -1511,12 +1481,12 @@
|
| |
|
| |
def handle_import_comps(goptions, session, args):
|
| |
"Import group/package information from a comps file"
|
| |
- usage = _("usage: %prog import-comps [options] <file> <tag>")
|
| |
+ usage = "usage: %prog import-comps [options] <file> <tag>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--force", action="store_true", help=_("force import"))
|
| |
+ parser.add_option("--force", action="store_true", help="force import")
|
| |
(local_options, args) = parser.parse_args(args)
|
| |
if len(args) != 2:
|
| |
- parser.error(_("Incorrect number of arguments"))
|
| |
+ parser.error("Incorrect number of arguments")
|
| |
activate_session(session, goptions)
|
| |
# check if the tag exists
|
| |
dsttag = session.getTag(args[1])
|
| |
@@ -1602,19 +1572,18 @@
|
| |
|
| |
def handle_import_sig(goptions, session, args):
|
| |
"[admin] Import signatures into the database and write signed RPMs"
|
| |
- usage = _("usage: %prog import-sig [options] <package> [<package> ...]")
|
| |
+ usage = "usage: %prog import-sig [options] <package> [<package> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
parser.add_option("--with-unsigned", action="store_true",
|
| |
- help=_("Also import unsigned sig headers"))
|
| |
+ help="Also import unsigned sig headers")
|
| |
parser.add_option("--write", action="store_true", help=SUPPRESS_HELP)
|
| |
- parser.add_option("--test", action="store_true",
|
| |
- help=_("Test mode -- don't actually import"))
|
| |
+ parser.add_option("--test", action="store_true", help="Test mode -- don't actually import")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("At least one package must be specified"))
|
| |
+ parser.error("At least one package must be specified")
|
| |
for path in args:
|
| |
if not os.path.exists(path):
|
| |
- parser.error(_("No such file: %s") % path)
|
| |
+ parser.error("No such file: %s" % path)
|
| |
activate_session(session, goptions)
|
| |
for path in args:
|
| |
data = koji.get_header_fields(path, ('name', 'version', 'release', 'arch', 'siggpg',
|
| |
@@ -1632,7 +1601,7 @@
|
| |
if not sigkey:
|
| |
sigkey = ""
|
| |
if not options.with_unsigned:
|
| |
- print(_("Skipping unsigned package: %s" % path))
|
| |
+ print("Skipping unsigned package: %s" % path)
|
| |
continue
|
| |
else:
|
| |
sigkey = koji.get_sigpacket_key_id(sigkey)
|
| |
@@ -1654,33 +1623,33 @@
|
| |
if previous:
|
| |
sighash = md5_constructor(sighdr).hexdigest()
|
| |
if previous[0]['sighash'] == sighash:
|
| |
- print(_("Signature already imported: %s") % path)
|
| |
+ print("Signature already imported: %s" % path)
|
| |
continue
|
| |
else:
|
| |
warn("signature mismatch: %s" % path)
|
| |
warn(" The system already has a signature for this rpm with key %s" % sigkey)
|
| |
warn(" The two signature headers are not the same")
|
| |
continue
|
| |
- print(_("Importing signature [key %s] from %s...") % (sigkey, path))
|
| |
+ print("Importing signature [key %s] from %s..." % (sigkey, path))
|
| |
if not options.test:
|
| |
session.addRPMSig(rinfo['id'], base64encode(sighdr))
|
| |
- print(_("Writing signed copy"))
|
| |
+ print("Writing signed copy")
|
| |
if not options.test:
|
| |
session.writeSignedRPM(rinfo['id'], sigkey)
|
| |
|
| |
|
| |
def handle_remove_sig(goptions, session, args):
|
| |
"[admin] Remove signed RPMs from db and disk"
|
| |
- usage = _("usage: %prog remove-sig [options] <rpm-id/n-v-r.a/rpminfo>")
|
| |
- description = _("Only use this method in extreme situations, because it ")
|
| |
- description += _("goes against Koji's design of immutable, auditable data.")
|
| |
+ usage = "usage: %prog remove-sig [options] <rpm-id/n-v-r.a/rpminfo>"
|
| |
+ description = "Only use this method in extreme situations, because it "
|
| |
+ description += "goes against Koji's design of immutable, auditable data."
|
| |
parser = OptionParser(usage=get_usage_str(usage), description=description)
|
| |
- parser.add_option("--sigkey", action="store", default=None, help=_("Specify signature key"))
|
| |
+ parser.add_option("--sigkey", action="store", default=None, help="Specify signature key")
|
| |
parser.add_option("--all", action="store_true", default=False,
|
| |
- help=_("Remove all signed copies for specified RPM"))
|
| |
+ help="Remove all signed copies for specified RPM")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("Please specify an RPM"))
|
| |
+ parser.error("Please specify an RPM")
|
| |
|
| |
if not options.all and not options.sigkey:
|
| |
error("Either --sigkey or --all options must be given")
|
| |
@@ -1704,16 +1673,15 @@
|
| |
|
| |
def handle_write_signed_rpm(goptions, session, args):
|
| |
"[admin] Write signed RPMs to disk"
|
| |
- usage = _("usage: %prog write-signed-rpm [options] <signature-key> <n-v-r> [<n-v-r> ...]")
|
| |
+ usage = "usage: %prog write-signed-rpm [options] <signature-key> <n-v-r> [<n-v-r> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--all", action="store_true",
|
| |
- help=_("Write out all RPMs signed with this key"))
|
| |
- parser.add_option("--buildid", help=_("Specify a build id rather than an n-v-r"))
|
| |
+ parser.add_option("--all", action="store_true", help="Write out all RPMs signed with this key")
|
| |
+ parser.add_option("--buildid", help="Specify a build id rather than an n-v-r")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("A signature key must be specified"))
|
| |
+ parser.error("A signature key must be specified")
|
| |
if len(args) < 2 and not (options.all or options.buildid):
|
| |
- parser.error(_("At least one RPM must be specified"))
|
| |
+ parser.error("At least one RPM must be specified")
|
| |
key = args.pop(0).lower()
|
| |
activate_session(session, goptions)
|
| |
if options.all:
|
| |
@@ -1760,22 +1728,22 @@
|
| |
|
| |
def handle_prune_signed_copies(goptions, session, args):
|
| |
"[admin] Prune signed copies"
|
| |
- usage = _("usage: %prog prune-signed-copies [options]")
|
| |
+ usage = "usage: %prog prune-signed-copies [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("-n", "--test", action="store_true", help=_("Test mode"))
|
| |
- parser.add_option("-v", "--verbose", action="store_true", help=_("Be more verbose"))
|
| |
- parser.add_option("--days", type="int", default=5, help=_("Timeout before clearing"))
|
| |
- parser.add_option("-p", "--package", "--pkg", help=_("Limit to a single package"))
|
| |
- parser.add_option("-b", "--build", help=_("Limit to a single build"))
|
| |
+ parser.add_option("-n", "--test", action="store_true", help="Test mode")
|
| |
+ parser.add_option("-v", "--verbose", action="store_true", help="Be more verbose")
|
| |
+ parser.add_option("--days", type="int", default=5, help="Timeout before clearing")
|
| |
+ parser.add_option("-p", "--package", "--pkg", help="Limit to a single package")
|
| |
+ parser.add_option("-b", "--build", help="Limit to a single build")
|
| |
parser.add_option("-i", "--ignore-tag", action="append", default=[],
|
| |
- help=_("Ignore these tags when considering whether a build is/was latest"))
|
| |
+ help="Ignore these tags when considering whether a build is/was latest")
|
| |
parser.add_option("--ignore-tag-file",
|
| |
- help=_("File to read tag ignore patterns from"))
|
| |
+ help="File to read tag ignore patterns from")
|
| |
parser.add_option("-r", "--protect-tag", action="append", default=[],
|
| |
- help=_("Do not prune signed copies from matching tags"))
|
| |
+ help="Do not prune signed copies from matching tags")
|
| |
parser.add_option("--protect-tag-file",
|
| |
- help=_("File to read tag protect patterns from"))
|
| |
- parser.add_option("--trashcan-tag", default="trashcan", help=_("Specify trashcan tag"))
|
| |
+ help="File to read tag protect patterns from")
|
| |
+ parser.add_option("--trashcan-tag", default="trashcan", help="Specify trashcan tag")
|
| |
# Don't use local debug option, this one stays here for backward compatibility
|
| |
# https://pagure.io/koji/issue/2084
|
| |
parser.add_option("--debug", action="store_true", default=goptions.debug, help=SUPPRESS_HELP)
|
| |
@@ -2111,12 +2079,12 @@
|
| |
|
| |
def handle_set_build_volume(goptions, session, args):
|
| |
"[admin] Move a build to a different volume"
|
| |
- usage = _("usage: %prog set-build-volume <volume> <n-v-r> [<n-v-r> ...]")
|
| |
+ usage = "usage: %prog set-build-volume <volume> <n-v-r> [<n-v-r> ...]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("-v", "--verbose", action="store_true", help=_("Be verbose"))
|
| |
+ parser.add_option("-v", "--verbose", action="store_true", help="Be verbose")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 2:
|
| |
- parser.error(_("You must provide a volume and at least one build"))
|
| |
+ parser.error("You must provide a volume and at least one build")
|
| |
volinfo = session.getVolume(args[0])
|
| |
if not volinfo:
|
| |
error("No such volume: %s" % args[0])
|
| |
@@ -2140,11 +2108,11 @@
|
| |
|
| |
def handle_add_volume(goptions, session, args):
|
| |
"[admin] Add a new storage volume"
|
| |
- usage = _("usage: %prog add-volume <volume-name>")
|
| |
+ usage = "usage: %prog add-volume <volume-name>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) != 1:
|
| |
- parser.error(_("Command requires exactly one volume-name."))
|
| |
+ parser.error("Command requires exactly one volume-name.")
|
| |
name = args[0]
|
| |
volinfo = session.getVolume(name)
|
| |
if volinfo:
|
| |
@@ -2156,7 +2124,7 @@
|
| |
|
| |
def anon_handle_list_volumes(goptions, session, args):
|
| |
"[info] List storage volumes"
|
| |
- usage = _("usage: %prog list-volumes")
|
| |
+ usage = "usage: %prog list-volumes"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
ensure_connection(session, goptions)
|
| |
@@ -2166,13 +2134,13 @@
|
| |
|
| |
def handle_list_permissions(goptions, session, args):
|
| |
"[info] List user permissions"
|
| |
- usage = _("usage: %prog list-permissions [options]")
|
| |
+ usage = "usage: %prog list-permissions [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--user", help=_("List permissions for the given user"))
|
| |
- parser.add_option("--mine", action="store_true", help=_("List your permissions"))
|
| |
+ parser.add_option("--user", help="List permissions for the given user")
|
| |
+ parser.add_option("--mine", action="store_true", help="List your permissions")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) > 0:
|
| |
- parser.error(_("This command takes no arguments"))
|
| |
+ parser.error("This command takes no arguments")
|
| |
activate_session(session, goptions)
|
| |
if options.user:
|
| |
user = session.getUser(options.user)
|
| |
@@ -2189,15 +2157,15 @@
|
| |
|
| |
def handle_add_user(goptions, session, args):
|
| |
"[admin] Add a user"
|
| |
- usage = _("usage: %prog add-user <username> [options]")
|
| |
+ usage = "usage: %prog add-user <username> [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--principal", help=_("The Kerberos principal for this user"))
|
| |
- parser.add_option("--disable", help=_("Prohibit logins by this user"), action="store_true")
|
| |
+ parser.add_option("--principal", help="The Kerberos principal for this user")
|
| |
+ parser.add_option("--disable", help="Prohibit logins by this user", action="store_true")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("You must specify the username of the user to add"))
|
| |
+ parser.error("You must specify the username of the user to add")
|
| |
elif len(args) > 1:
|
| |
- parser.error(_("This command only accepts one argument (username)"))
|
| |
+ parser.error("This command only accepts one argument (username)")
|
| |
username = args[0]
|
| |
if options.disable:
|
| |
status = koji.USER_STATUS['BLOCKED']
|
| |
@@ -2210,13 +2178,13 @@
|
| |
|
| |
def handle_enable_user(goptions, session, args):
|
| |
"[admin] Enable logins by a user"
|
| |
- usage = _("usage: %prog enable-user <username>")
|
| |
+ usage = "usage: %prog enable-user <username>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("You must specify the username of the user to enable"))
|
| |
+ parser.error("You must specify the username of the user to enable")
|
| |
elif len(args) > 1:
|
| |
- parser.error(_("This command only accepts one argument (username)"))
|
| |
+ parser.error("This command only accepts one argument (username)")
|
| |
username = args[0]
|
| |
activate_session(session, goptions)
|
| |
session.enableUser(username)
|
| |
@@ -2224,13 +2192,13 @@
|
| |
|
| |
def handle_disable_user(goptions, session, args):
|
| |
"[admin] Disable logins by a user"
|
| |
- usage = _("usage: %prog disable-user <username>")
|
| |
+ usage = "usage: %prog disable-user <username>"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("You must specify the username of the user to disable"))
|
| |
+ parser.error("You must specify the username of the user to disable")
|
| |
elif len(args) > 1:
|
| |
- parser.error(_("This command only accepts one argument (username)"))
|
| |
+ parser.error("This command only accepts one argument (username)")
|
| |
username = args[0]
|
| |
activate_session(session, goptions)
|
| |
session.disableUser(username)
|
| |
@@ -2238,22 +2206,20 @@
|
| |
|
| |
def handle_edit_user(goptions, session, args):
|
| |
"[admin] Alter user information"
|
| |
- usage = _("usage: %prog edit-user <username> [options]")
|
| |
+ usage = "usage: %prog edit-user <username> [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
- parser.add_option("--rename", help=_("Rename the user"))
|
| |
- parser.add_option("--edit-krb", action="append", default=[],
|
| |
- metavar="OLD=NEW",
|
| |
- help=_("Change kerberos principal of the user"))
|
| |
+ parser.add_option("--rename", help="Rename the user")
|
| |
+ parser.add_option("--edit-krb", action="append", default=[], metavar="OLD=NEW",
|
| |
+ help="Change kerberos principal of the user")
|
| |
parser.add_option("--add-krb", action="append", default=[], metavar="KRB",
|
| |
- help=_("Add kerberos principal of the user"))
|
| |
- parser.add_option("--remove-krb", action="append", default=[],
|
| |
- metavar="KRB",
|
| |
- help=_("Remove kerberos principal of the user"))
|
| |
+ help="Add kerberos principal of the user")
|
| |
+ parser.add_option("--remove-krb", action="append", default=[], metavar="KRB",
|
| |
+ help="Remove kerberos principal of the user")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if len(args) < 1:
|
| |
- parser.error(_("You must specify the username of the user to edit"))
|
| |
+ parser.error("You must specify the username of the user to edit")
|
| |
elif len(args) > 1:
|
| |
- parser.error(_("This command only accepts one argument (username)"))
|
| |
+ parser.error("This command only accepts one argument (username)")
|
| |
activate_session(session, goptions)
|
| |
user = args[0]
|
| |
princ_mappings = []
|
| |
@@ -2269,18 +2235,18 @@
|
| |
|
| |
def handle_list_signed(goptions, session, args):
|
| |
"[admin] List signed copies of rpms"
|
| |
- usage = _("usage: %prog list-signed [options]")
|
| |
+ usage = "usage: %prog list-signed [options]"
|
| |
parser = OptionParser(usage=get_usage_str(usage))
|
| |
# Don't use local debug option, this one stays here for backward compatibility
|
| |
# https://pagure.io/koji/issue/2084
|
| |
parser.add_option("--debug", action="store_true", default=goptions.debug, help=SUPPRESS_HELP)
|
| |
- parser.add_option("--key", help=_("Only list RPMs signed with this key"))
|
| |
- parser.add_option("--build", help=_("Only list RPMs from this build"))
|
| |
- parser.add_option("--rpm", help=_("Only list signed copies for this RPM"))
|
| |
- parser.add_option("--tag", help=_("Only list RPMs within this tag"))
|
| |
+ parser.add_option("--key", help="Only list RPMs signed with this key")
|
| |
+ parser.add_option("--build", help="Only list RPMs from this build")
|
| |
+ parser.add_option("--rpm", help="Only list signed copies for this RPM")
|
| |
+ parser.add_option("--tag", help="Only list RPMs within this tag")
|
| |
(options, args) = parser.parse_args(args)
|
| |
if not options.build and not options.tag and not options.rpm:
|
| |
- parser.error(_("At least one from --build, --rpm, --tag needs to be specified."))
|
| |
+ parser.error("At least one from --build, --rpm, --tag needs to be specified.")
|
| |
activate_session(session, goptions)
|
| |
qopts = {}
|
| |
build_idx = {}
|
| |
@@ -2298,8 +2264,8 @@
|
| |
rinfo = session.getRPM(rpm_info, strict=True)
|
| |
rpm_idx[rinfo['id']] = rinfo
|
| |
if rinfo.get('external_repo_id'):
|
| |
- parser.error(_("External rpm: %(name)s-%(version)s-%(release)s.%(arch)s@"
|
| |
- "%(external_repo_name)s") % rinfo)
|
| |
+ parser.error("External rpm: %(name)s-%(version)s-%(release)s.%(arch)s@"
|
| |
+ "%(external_repo_name)s" % rinfo)
|
| |
sigs += session.queryRPMSigs(rpm_id=rinfo['id'], **qopts)
|
| |
if options.build:
|
| |
build = options.build
|
| |
@@ -2360,47 +2326,46 @@
|
| |
|
| |
def handle_import_archive(options, session, args):
|
| |
"[admin] Import an archive file and associate it with a build"
|
| |
- usage = _("usage: %prog import-archive <build-id|n-v-r> <archive_path> [<archive_path2 ...]")
|
| |
+ usage = "usage: %prog import-archive <build-id|n-v-r> <archive_path> [<archive_path2 ...]"
|
| |