Test parent tag existence before query for its id
If client called:
$ koji add-tag new-tag-name --parent nonexistent-tag
it failed with error:
xmlrpclib.Fault: <Fault 1: 'exceptions.TypeError: unsubscriptable
object'>
This commit is contained in:
parent
cd45e886cc
commit
07ea07f875
1 changed files with 1 additions and 1 deletions
|
|
@ -2718,9 +2718,9 @@ def create_tag(name, parent=None, arches=None, perm=None, locked=False, maven_su
|
|||
# Does the parent exist?
|
||||
if parent:
|
||||
parent_tag = get_tag(parent)
|
||||
parent_id = parent_tag['id']
|
||||
if not parent_tag:
|
||||
raise koji.GenericError("Parent tag '%s' could not be found" % parent)
|
||||
parent_id = parent_tag['id']
|
||||
else:
|
||||
parent_id = None
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue