Allow the poller to clean up module builds without arches

This commit is contained in:
mprahl
2019-07-08 08:43:42 -04:00
parent b3c32ec859
commit ddafbb86ff
2 changed files with 4 additions and 1 deletions

View File

@@ -181,7 +181,9 @@ class KojiModuleBuilder(GenericBuilder):
self.koji_session = self.get_session(config)
self.arches = [arch.name for arch in self.module.arches]
if not self.arches:
# Allow KojiModuleBuilder to be initialized if no arches are set but the module is in
# a failed set. This will allow the clean up of old module builds.
if not self.arches and module.state not in models.FAILED_STATES:
raise ValueError("No arches specified in module build.")
# These eventually get populated by calling _connect and __prep is set to True

View File

@@ -82,6 +82,7 @@ BUILD_STATES = {
}
INVERSE_BUILD_STATES = {v: k for k, v in BUILD_STATES.items()}
FAILED_STATES = (BUILD_STATES["failed"], BUILD_STATES["garbage"])
def _utc_datetime_to_iso(datetime_object):