Distro, in composer terms "distribution", and "image_type" are required for composer, so make that explicit everywhere in the code.
21 lines
647 B
Python
21 lines
647 B
Python
import sys
|
|
|
|
import logging
|
|
import koji
|
|
from koji.context import context
|
|
|
|
sys.path.insert(0, "/usr/share/koji-hub/")
|
|
import kojihub
|
|
|
|
|
|
@koji.plugin.export
|
|
def osbuildImage(name, version, distro, image_types, target, arches, opts=None, priority=None):
|
|
"""Create an image via osbuild"""
|
|
context.session.assertPerm("image")
|
|
args = [name, version, distro, image_types, target, arches, opts]
|
|
task = {"channel": "image"}
|
|
|
|
if priority and priority < 0 and not context.session.hasPerm('admin'):
|
|
raise koji.ActionNotAllowed('only admins may create high-priority tasks')
|
|
|
|
return kojihub.make_task('osbuildImage', args, **task)
|