added some TODOs and comments fixed an error when viewing an incomplete appliance task in kojiweb renamed the appliance-build directive to spin-appliance
This commit is contained in:
parent
a90f0d1b03
commit
005963851c
3 changed files with 13 additions and 7 deletions
|
|
@ -2385,6 +2385,7 @@ class ApplianceTask(ImageTask):
|
|||
results.append(os.path.join(broot.rootdir(), 'tmp',
|
||||
directory, f))
|
||||
self.logger.debug('output: %s' % results)
|
||||
# TODO: allow for multiple disk images to be generated
|
||||
if len(results) > 2:
|
||||
raise koji.ApplianceError, \
|
||||
"Only one disk image allowed for output! found: %s" % results
|
||||
|
|
|
|||
6
cli/koji
6
cli/koji
|
|
@ -3949,11 +3949,13 @@ def handle_spin_livecd(options, session, args):
|
|||
assert False
|
||||
_build_image(options, task_options, session, args, 'livecd')
|
||||
|
||||
def handle_appliance_build(options, session, args):
|
||||
# This handler is for spinning appliance images
|
||||
#
|
||||
def handle_spin_appliance(options, session, args):
|
||||
"""[admin] Create an appliance given a kickstart file"""
|
||||
|
||||
# Usage & option parsing
|
||||
usage = _("usage: %prog appliance_build [options] <target> <arch> " +
|
||||
usage = _("usage: %prog spin-appliance [options] <target> <arch> " +
|
||||
"<kickstart-file>")
|
||||
usage += _("\n(Specify the --help global option for a list of other " +
|
||||
"help options)")
|
||||
|
|
|
|||
|
|
@ -4986,6 +4986,7 @@ def importImageInternal(task_id, filename, filesize, arch, mediatype, hash, rpml
|
|||
imageinfo['arch'] = arch
|
||||
imageinfo['mediatype'] = mediatype
|
||||
imageinfo['hash'] = hash
|
||||
# TODO: add xmlfile field to the imageinfo table
|
||||
|
||||
koji.plugin.run_callbacks('preImport', type='image', image=imageinfo)
|
||||
|
||||
|
|
@ -5167,7 +5168,7 @@ class RootExports(object):
|
|||
raise koji.GenericError, 'no image for task ID: %i' % taskID
|
||||
|
||||
# find the accompanying xml file, if any
|
||||
if ret['mediatype'] != 'LiveCD ISO':
|
||||
if ret != None and ret['mediatype'] != 'LiveCD ISO':
|
||||
imagepath = os.path.join(koji.pathinfo.imageFinalPath(),
|
||||
koji.pathinfo.applianceRelPath(ret['id']))
|
||||
out_files = os.listdir(imagepath)
|
||||
|
|
@ -7684,14 +7685,16 @@ class HostExports(object):
|
|||
_tag_build(tag,build,user_id=user_id,force=force)
|
||||
|
||||
def importImage(self, task_id, filename, filesize, arch, mediatype, hash, rpmlist):
|
||||
"""Import a built image, populating the database with metadata and moving the image
|
||||
to its final location."""
|
||||
"""
|
||||
Import a built image, populating the database with metadata and
|
||||
moving the image to its final location.
|
||||
"""
|
||||
host = Host()
|
||||
host.verify()
|
||||
task = Task(task_id)
|
||||
task.assertHost(host.id)
|
||||
image_id = importImageInternal(task_id, filename, filesize, arch, mediatype,
|
||||
hash, rpmlist)
|
||||
image_id = importImageInternal(task_id, filename, filesize, arch,
|
||||
mediatype, hash, rpmlist)
|
||||
moveImageResults(task_id, image_id, arch, mediatype)
|
||||
return image_id
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue