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:
Jesse Keating 2010-12-02 15:24:48 -08:00
parent 6ed3b64c36
commit bcf2a793ea

View file

@ -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'])