ensure repos dir

Fixes https://pagure.io/koji/issue/4315
This commit is contained in:
Mike McLean 2025-02-11 10:36:21 -05:00 committed by Tomas Kopecek
parent 2a7585bc99
commit 7e71f18212
2 changed files with 12 additions and 0 deletions

View file

@ -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

View file

@ -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