diff --git a/kojihub/kojihub.py b/kojihub/kojihub.py index 24f8eda7..88c6ee4d 100644 --- a/kojihub/kojihub.py +++ b/kojihub/kojihub.py @@ -13605,8 +13605,14 @@ class RootExports(object): pass else: context.session.assertPerm('regen-repo') + # raise error when tag does not exist get_tag(tag, strict=True, event=event) + + # make sure repos dir exists, otherwise hosts will reject task + repos_dir = joinpath(koji.pathinfo.topdir, 'repos') + koji.ensuredir(repos_dir) + opts = {} if event is not None: opts['event'] = event diff --git a/kojihub/repos.py b/kojihub/repos.py index a9ab40a8..ba92d118 100644 --- a/kojihub/repos.py +++ b/kojihub/repos.py @@ -8,6 +8,7 @@ import koji from . import kojihub from koji.context import context +from koji.util import joinpath from kojihub.db import (QueryView, UpdateProcessor, BulkUpdateProcessor, InsertProcessor, nextval, Savepoint, QueryProcessor, db_lock, DeleteProcessor) @@ -376,6 +377,11 @@ def repo_queue_task(req): # TODO should we error if user doesn't exist if user_id: taskopts['owner'] = user_id + + # make sure repos dir exists, otherwise hosts will reject task + repos_dir = joinpath(koji.pathinfo.topdir, 'repos') + koji.ensuredir(repos_dir) + task_id = kojihub.make_task('newRepo', args, **taskopts) return task_id # caller should update request entry if needed