From 08d17d953dabc39eb0a79c7240cf38bacc1da26b Mon Sep 17 00:00:00 2001 From: Mike McLean Date: May 16 2016 18:02:06 +0000 Subject: make sure livemedia options are passed through to task --- diff --git a/builder/kojid b/builder/kojid index 3070261..514886f 100755 --- a/builder/kojid +++ b/builder/kojid @@ -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) diff --git a/cli/koji b/cli/koji index 89d8f4e..0606e72 100755 --- a/cli/koji +++ b/cli/koji @@ -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