Do not ignore building components to reset state when submit an existing module build

koji.BUILD_STATE["BUILDING"] equals to 0. So, checking if
component.state is None explicitly to avoid ignoring the components
which are in building state.

Signed-off-by: Chenxiong Qi <cqi@redhat.com>
This commit is contained in:
Chenxiong Qi
2019-09-11 09:52:24 +08:00
parent 47809d530a
commit c54c3a288b

View File

@@ -975,7 +975,7 @@ def submit_module_build(db_session, username, mmd, params):
log.debug("Resuming existing module build %r" % module)
# Reset all component builds that didn't complete
for component in module.component_builds:
if component.state and component.state != koji.BUILD_STATES["COMPLETE"]:
if component.state is not None and component.state != koji.BUILD_STATES["COMPLETE"]:
component.state = None
component.state_reason = None
db_session.add(component)