have koji to gracefully hanle noneexistent tasks

This commit is contained in:
Xibo Ning 2016-09-07 17:22:16 +08:00 committed by Mike McLean
parent 4b36a8f2f9
commit 1bcc8c6433

View file

@ -4415,6 +4415,10 @@ def _printTaskInfo(session, task_id, level=0, recurse=True, verbose=True):
indent = " "*2*level
info = session.getTaskInfo(task_id)
if info is None:
raise koji.GenericError, "No such task: %d" % task_id
if info['host_id']:
host_info = session.getHost(info['host_id'])
else: