ensure that wait() is being called only in wait state

* I'm little bit suspicious that something is calling wait() from other states as well
* This is to keep track of such calls, so we can identify them later
This commit is contained in:
Lubos Kocman
2016-07-18 22:31:24 +02:00
parent bd28b7852a
commit fe7c9dbec0

View File

@@ -42,6 +42,11 @@ def wait(config, session, msg):
"""
build = rida.database.ModuleBuild.from_fedmsg(session, msg)
module_info = build.json()
if module_info['state'] != rida.BUILD_STATES["wait"]:
# XXX: not sure why did we get here from state == 2 (building) FIXTHIS
print("Invalid state %s for wait()" % module_info['state'])
log.error("Invalid state %s for wait(). Msg=%s" % (module_info['state'], msg))
return
log.info("Found module_info=%s from message" % module_info)
pdc_session = rida.pdc.get_pdc_client_session(config)