From 5e420a61ee6ad855b3f7c678fe478369d48622c1 Mon Sep 17 00:00:00 2001 From: Ralph Bean Date: Fri, 3 Nov 2017 11:38:54 -0400 Subject: [PATCH] Some more useful error messages. @jaruga hit this today. The error message didn't contain enough information to debug appropriately. --- module_build_service/utils.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/module_build_service/utils.py b/module_build_service/utils.py index 73ea89d8..5357eb01 100644 --- a/module_build_service/utils.py +++ b/module_build_service/utils.py @@ -773,9 +773,12 @@ def format_mmd(mmd, scmurl, session=None): for pkgname, pkg in mmd.components.rpms.items(): if pkg.repository and not conf.rpms_allow_repository: raise Forbidden( - "Custom component repositories aren't allowed") + "Custom component repositories aren't allowed. " + "%r bears repository %r" % (pkgname, pkg.repository)) if pkg.cache and not conf.rpms_allow_cache: - raise Forbidden("Custom component caches aren't allowed") + raise Forbidden( + "Custom component caches aren't allowed. " + "%r bears cache %r" % (pkgname, pkg.cache)) if not pkg.repository: pkg.repository = conf.rpms_default_repository + pkgname if not pkg.cache: @@ -787,7 +790,8 @@ def format_mmd(mmd, scmurl, session=None): for modname, mod in mmd.components.modules.items(): if mod.repository and not conf.modules_allow_repository: raise Forbidden( - "Custom component repositories aren't allowed") + "Custom module repositories aren't allowed. " + "%r bears repository %r" % (modname, mod.repository)) if not mod.repository: mod.repository = conf.modules_default_repository + modname if not mod.ref: @@ -814,7 +818,8 @@ def validate_mmd(mmd): for modname, mod in mmd.components.modules.items(): if mod.repository and not conf.modules_allow_repository: raise Forbidden( - "Custom component repositories aren't allowed") + "Custom module repositories aren't allowed. " + "%r bears repository %r" % (modname, mod.repository)) def merge_included_mmd(mmd, included_mmd):