From 1f54dbdf8f8b8569539da6e2be256785f0b2135a Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Tue, 11 Apr 2023 23:02:01 -0400 Subject: [PATCH] watch-tasks: show host for assigned tasks --- cli/koji_cli/lib.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cli/koji_cli/lib.py b/cli/koji_cli/lib.py index 2ec1a1fd..c605940f 100644 --- a/cli/koji_cli/lib.py +++ b/cli/koji_cli/lib.py @@ -261,12 +261,13 @@ class TaskWatcher(object): # not finished either. info would be none. if not info: return 'unknown' - if info['state'] == koji.TASK_STATES['OPEN']: + if koji.TASK_STATES[info['state']] in ['OPEN', 'ASSIGNED']: + state = koji.TASK_STATES[info['state']].lower() if info['host_id']: host = self.session.getHost(info['host_id']) - return 'open (%s)' % host['name'] + return '%s (%s)' % (state, host['name']) else: - return 'open' + return state elif info['state'] == koji.TASK_STATES['FAILED']: s = 'FAILED: %s' % self.get_failure()