From 0e68d4f300cf6bca0d7808666e2500977b266e6b Mon Sep 17 00:00:00 2001 From: Ken Dreyer Date: Feb 01 2022 14:40:10 +0000 Subject: hub: improve inheritance priority collision error message When users set multiple parents to the same priority in setInheritanceData(), we raise an error because this is an invalid configuration. Improve the error message to make it easier for humans to understand the problem and explain which tag ID ints are parents or children. --- diff --git a/hub/kojihub.py b/hub/kojihub.py index 40dfe8b..c598f87 100644 --- a/hub/kojihub.py +++ b/hub/kojihub.py @@ -766,8 +766,9 @@ def _writeInheritanceData(tag_id, changes, clear=False): continue # oops, duplicate entries for a single priority dup_ids = [link['parent_id'] for link in dups] - raise koji.GenericError("Inheritance priorities must be unique (pri %s: %r )" % - (pri, dup_ids)) + raise koji.GenericError("Multiple parent tags (%r) cannot have the " + "same priority value (%d) on child tag %d" % + (dup_ids, pri, tag_id)) for parent_id, link in data.items(): if not link.get('is_update'): continue