make sure livemedia options are passed through to task

This commit is contained in:
Mike McLean 2015-12-15 13:00:55 -05:00
parent cbd6ca9ced
commit 08d17d953d
2 changed files with 16 additions and 8 deletions

View file

@ -2965,16 +2965,16 @@ class LiveMediaTask(ImageTask):
]
# Determine what LMC opperation we are doing: live-iso, live-pxe, disk-img.
if live_iso:
if opts.get('live_iso'):
# we set the fs label to the same as the isoname if it exists,
# taking at most 32 characters
isoname = '%s-%s-%s' % (name, version, release)
cmd.extend(['--make-iso', '--volid', isoname[:32]])
elif live_ostree_pxe:
elif opts.get('live_ostree_pxe'):
cmd.extend(['--make-ostree-live'])
elif disk_img:
elif opts.get('disk_img'):
img_name='disk.img'
prj_name='Fedora'
cmd.extend(['--make-disk',
@ -2985,8 +2985,8 @@ class LiveMediaTask(ImageTask):
else:
# bail
raise koji.LiveMediaError, \
'This task needs an option: --live-iso or --live-ostree-pxe or --disk-img'
raise koji.LiveMediaError('Please specify one of the following '
'options: live_iso, live_ostree_pxe, or disk_img')
# Run livemedia-creator
rv = broot.mock(['--cwd', '/tmp', '--chroot', '--'] + cmd)

View file

@ -5261,6 +5261,11 @@ def handle_spin_livemedia(options, session, args):
help=_("Spin live ISO media"))
(task_options, args) = parser.parse_args(args)
if (not task_options.live_ostree_pxe and not task_options.disk_img
and not task_options.live_iso):
parser.error(_("Please specify one of the following options: "
"--live-ostree-pxe, --disk-img, or --live-iso"))
# Make sure the target and kickstart is specified.
if len(args) != 5:
parser.error(_("Five arguments are required: a name, a version, an" +
@ -5631,10 +5636,13 @@ def _build_image(options, task_opts, session, args, img_type):
ksfile = os.path.join(serverdir, os.path.basename(ksfile))
print
passthru_opts = [
'isoname', 'ksurl', 'ksversion', 'scratch', 'repo',
'release', 'skip_tag', 'vmem', 'vcpu', 'format', 'specfile',
'live_ostree_pxe', 'disk_img', 'live_ostree_pxe', 'live_iso',
]
hub_opts = {}
for opt in ('isoname', 'ksurl', 'ksversion', 'scratch', 'repo',
'release', 'skip_tag', 'vmem', 'vcpu', 'format', 'specfile',
'live_ostree_pxe'):
for opt in passthru_opts:
val = getattr(task_opts, opt, None)
if val is not None:
hub_opts[opt] = val