Hi,
The attached patch adds --wait flags, needed when you're not in a tty
(e.g. cron job) and want to wait upon task completion.
Cheers
-- Dennis
--- koji 2010-04-08 17:12:49.000000000 -0400
+++ /usr/bin/koji 2010-05-18 12:16:47.000000000 -0400
@@ -4145,8 +4145,10 @@
usage += _("\n(Specify the --help global option for a list of other " +
"help options)")
parser = OptionParser(usage=usage)
- parser.add_option("--nowait", action="store_true",
- help=_("Don't wait on livecd creation"))
+ parser.add_option("--wait", action="store_true",
+ help=_("Wait on the livecd creation, even if running in the background"))
+ parser.add_option("--nowait", action="store_false", dest="wait",
+ help=_("Don't wait on livecd creation"))
parser.add_option("--noprogress", action="store_true",
help=_("Do not display progress of the upload"))
parser.add_option("--background", action="store_true",
@@ -4184,8 +4186,10 @@
usage += _("\n(Specify the --help global option for a list of other " +
"help options)")
parser = OptionParser(usage=usage)
- parser.add_option("--nowait", action="store_true",
- help=_("Do not wait on appliance creation."))
+ parser.add_option("--wait", action="store_true",
+ help=_("Wait on the appliance creation, even if running in the background"))
+ parser.add_option("--nowait", action="store_false", dest="wait",
+ help=_("Don't wait on appliance creation"))
parser.add_option("--noprogress", action="store_true",
help=_("Do not display progress of the upload."))
parser.add_option("--background", action="store_true",
@@ -4271,13 +4275,17 @@
ksfile = os.path.join(serverdir, os.path.basename(ksfile))
print
+ # don't send the 'wait' option to the hub
+ wait = task_opts.wait
+ del task_opts.wait
+
# finally, create the task.
task_id = session.buildImage(arch, target, ksfile, img_type,
opts=task_opts, priority=priority)
print "Created task:", task_id
print "Task info: %s/taskinfo?taskID=%s" % (options.weburl, task_id)
- if _running_in_bg() or task_opts.nowait:
+ if not wait and (_running_in_bg() or wait is False):
return
else:
session.logout()
--
buildsys mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/buildsys