Fix a bug where we could traceback on ^c
If a user ^cs a build before a task gets created, we could wind up trying to get a status out of it and tracing back. We already check for this in is_done, do the same in display_state.
This commit is contained in:
parent
6ed3b64c36
commit
bcf2a793ea
1 changed files with 4 additions and 0 deletions
4
cli/koji
4
cli/koji
|
|
@ -321,6 +321,10 @@ class TaskWatcher(object):
|
|||
return (state == 'CLOSED')
|
||||
|
||||
def display_state(self, info):
|
||||
# We can sometimes be passed a task that is not yet open, but
|
||||
# not finished either. info would be none.
|
||||
if not info:
|
||||
return 'unknown'
|
||||
if info['state'] == koji.TASK_STATES['OPEN']:
|
||||
if info['host_id']:
|
||||
host = self.session.getHost(info['host_id'])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue