run checks earlier for cg_import

Related: https://pagure.io/koji/issue/426
This commit is contained in:
Tomas Kopecek 2017-06-01 15:34:52 +02:00 committed by Mike McLean
parent bc02f03d3e
commit b81159bc2d

View file

@ -5633,6 +5633,14 @@ class CG_Importer(object):
raise koji.GenericError('Output type %s not listed in build '
'types' % btype)
if btype not in legacy_types:
raise koji.BuildError('unsupported archive type: %s' % type)
if koji.CHECKSUM_TYPES[fileinfo['checksum_type']] != 'md5':
# XXX
# until we change the way we handle checksums, we have to limit this to md5
raise koji.GenericError("Unsupported checksum type: %(checksum_type)s" % fileinfo)
fileinfo['hub.btype'] = btype
fileinfo['hub.type_info'] = type_info