From f92041a64b151be9166fc14b1103a207ca0ed361 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Aug 23 2019 20:02:35 +0000 Subject: [PATCH 1/2] correct error text --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 3e3a601..7445f77 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -6636,7 +6636,7 @@ def import_archive_internal(filepath, buildinfo, type, typeInfo, buildroot_id=No archiveinfo['type_id'] = archivetype['id'] btype = lookup_name('btype', type, strict=False) if btype is None: - raise koji.BuildError('unsupported archive type: %s' % type) + raise koji.BuildError('unsupported build type: %s' % type) archiveinfo['btype_id'] = btype['id'] # cg extra data From 1889aa04dc45ae0117d57922bdb0e58b0ec422e7 Mon Sep 17 00:00:00 2001 From: Mike McLean Date: Aug 23 2019 20:02:35 +0000 Subject: [PATCH 2/2] 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