call host.refuseTask when host check fails

This commit is contained in:
Mike McLean 2023-05-07 23:21:53 -04:00 committed by Tomas Kopecek
parent 8716d8552d
commit 40660bbb42

View file

@ -1429,6 +1429,8 @@ class TaskManager(object):
if not valid_host:
self.logger.info(
'Skipping task %s (%s) due to host check', task['id'], task['method'])
if task['state'] == koji.TASK_STATES['ASSIGNED']:
self.session.host.refuseTask(task_id, soft=False, msg='failed host check')
return False
data = self.session.host.openTask(task['id'])
if data is None: