From da1153fc33029106e08e71ce8e494033a2c9f110 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Aug 28 2019 13:17:27 +0000 Subject: raise an error when adding an archive of the wrong type --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 7445f77..96196c9 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -6637,6 +6637,8 @@ def import_archive_internal(filepath, buildinfo, type, typeInfo, buildroot_id=No btype = lookup_name('btype', type, strict=False) if btype is None: raise koji.BuildError('unsupported build type: %s' % type) + if btype not in get_build_type(buildinfo, strict=True): + raise koji.ImportError('Build does not have type %s', btype) archiveinfo['btype_id'] = btype['id'] # cg extra data