mirror of
https://pagure.io/fm-orchestrator.git
synced 2026-02-13 18:15:00 +08:00
Don't handle koji messages with null task_id values.
Otherwise, we query for null==null in our DB and chaos ensues.
This commit is contained in:
@@ -186,6 +186,10 @@ class BaseMessage(object):
|
||||
build_version = msg_inner_msg.get('version')
|
||||
build_release = msg_inner_msg.get('release')
|
||||
|
||||
if task_id is None:
|
||||
log.debug("Saw a koji build change with no task_id.")
|
||||
return
|
||||
|
||||
msg_obj = KojiBuildChange(
|
||||
msg_id, build_id, task_id, build_new_state, build_name,
|
||||
build_version, build_release)
|
||||
@@ -225,6 +229,8 @@ class KojiBuildChange(BaseMessage):
|
||||
def __init__(self, msg_id, build_id, task_id, build_new_state, build_name,
|
||||
build_version, build_release, module_build_id=None,
|
||||
state_reason=None):
|
||||
if task_id is None:
|
||||
raise ValueError("KojiBuildChange with a null task_id is invalid.")
|
||||
super(KojiBuildChange, self).__init__(msg_id)
|
||||
self.build_id = build_id
|
||||
self.task_id = task_id
|
||||
|
||||
@@ -50,6 +50,8 @@ def _finalize(config, session, msg, state):
|
||||
log.debug("We have no record of %s" % nvr)
|
||||
return
|
||||
|
||||
log.info("Saw relevant component build of %r from %r." % (nvr, msg.msg_id))
|
||||
|
||||
if msg.state_reason:
|
||||
state_reason = msg.state_reason
|
||||
elif state != koji.BUILD_STATES['COMPLETE']:
|
||||
|
||||
Reference in New Issue
Block a user