From 65ce3430911bf5ec7e1ed2cd1ea119edb8995d70 Mon Sep 17 00:00:00 2001 From: Ondrej Nosek Date: May 13 2019 15:31:36 +0000 Subject: Custom progname for watch_tasks Output text states that there is a command-line 'watch_task' subcommand. When koji library is imported in rhpkg/fedpkg tool, it shows that command is rhpkg/fedpkg instead of 'brew/koji watch_task'. Additional fix in rpkg library is needed after this change is released. Relates: rhbz#1570921 Relates: COMPOSE-2809 Signed-off-by: Ondrej Nosek --- diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py index 8e8bf99..44f9ba7 100644 --- a/cli/koji_cli/lib.py +++ b/cli/koji_cli/lib.py @@ -278,7 +278,7 @@ def display_task_results(tasks): print('%s has not completed' % task_label) -def watch_tasks(session, tasklist, quiet=False, poll_interval=60, ki_handler=None): +def watch_tasks(session, tasklist, quiet=False, poll_interval=60, ki_handler=None, custom_progname=None): if not tasklist: return if not quiet: @@ -329,7 +329,7 @@ Running Tasks: time.sleep(poll_interval) except KeyboardInterrupt: if tasks: - progname = os.path.basename(sys.argv[0]) or 'koji' + progname = custom_progname or os.path.basename(sys.argv[0]) or 'koji' ki_handler(progname, tasks, quiet) raise return rv