debian-koji-osbuild/plugins/hub/osbuild.py
Christian Kellner 8fb1342631 Make image_type and distro required arguments
Distro, in composer terms "distribution", and "image_type" are
required for composer, so make that explicit everywhere in the
code.
2020-09-08 16:13:48 +02:00

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)