From deb738fc1d4fa4782bde7ac20494e303c5d6b3d4 Mon Sep 17 00:00:00 2001 From: Brendan Reilly Date: Feb 21 2019 21:37:35 +0000 Subject: Added warnings and failures for too long volid --- diff --git a/builder/kojid b/builder/kojid index 7487c1d..53e2686 100755 --- a/builder/kojid +++ b/builder/kojid @@ -3156,7 +3156,9 @@ class LiveCDTask(ImageTask): if not volid: volid = self._shortenVolID(name, version, release) else: - volid = volid[:32] + if len(volid) > 32: + logger.warning("volume ID is longer than 32 characters, it will be truncated") + volid = volid[:32] cmd.extend(['-f', volid]) # Run livecd-creator @@ -3347,7 +3349,9 @@ class LiveMediaTask(ImageTask): if not volid: volid = self._shortenVolID(name, version, release) else: - volid = volid[:32] + if len(volid) > 32: + logger.warning("volume ID is longer than 32 characters, it will be truncated") + volid = volid[:32] # note: at the moment, we are only generating live isos. We may add support # for other types in the future diff --git a/cli/koji_cli/commands.py b/cli/koji_cli/commands.py index a7089df..1ff464d 100644 --- a/cli/koji_cli/commands.py +++ b/cli/koji_cli/commands.py @@ -5493,6 +5493,8 @@ def handle_spin_livecd(options, session, args): " architecture, a build target, and a relative path to" + " a kickstart file.")) assert False # pragma: no cover + if task_options.volid is not None and len(task_options.volid) > 32: + parser.error(_('Volume ID has a maximum length of 32 characters')) return _build_image(options, task_options, session, args, 'livecd') @@ -5554,6 +5556,8 @@ def handle_spin_livemedia(options, session, args): if task_options.lorax_url is not None and task_options.lorax_dir is None: parser.error(_('The "--lorax_url" option requires that "--lorax_dir" ' 'also be used.')) + if task_options.volid is not None and len(task_options.volid) > 32: + parser.error(_('Volume ID has a maximum length of 32 characters')) return _build_image(options, task_options, session, args, 'livemedia')