Don't emit media labels with spaces in them.

Spaces cause various bugs like #923374 and #855849 , and it would be
better if we just didn't use them.

Note that there's a corresponding pungi change to go with this.

Signed-off-by: Peter Jones <pjones@redhat.com>
This commit is contained in:
Peter Jones 2014-06-30 16:42:11 -04:00
parent 984ebfbef3
commit c789f20b66
4 changed files with 8 additions and 2 deletions

View File

@ -6,6 +6,9 @@ PXEBOOTDIR="images/pxeboot"
BOOTDIR="isolinux"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
## Don't allow spaces or escape characters in the iso label
isolabel = ''.join(ch if ch.isalnum() else '-' for ch in isolabel)
%>
mkdir ${LIVEDIR}

View File

@ -6,6 +6,9 @@ PXEBOOTDIR="images/pxeboot"
BOOTDIR="isolinux"
KERNELDIR=PXEBOOTDIR
LIVEDIR="LiveOS"
## Don't allow spaces or escape characters in the iso label
isolabel = ''.join(ch if ch.isalnum() else '-' for ch in isolabel)
%>
mkdir ${LIVEDIR}

View File

@ -242,7 +242,7 @@ class Lorax(BaseLoraxClass):
# NOTE: if you change isolabel, you need to change pungi to match, or
# the pungi images won't boot.
isolabel = volid or "{0.name} {0.version} {1.basearch}".format(self.product,
isolabel = volid or "{0.name}-{0.version}-{1.basearch}".format(self.product,
self.arch)
if len(isolabel) > 32:

View File

@ -557,7 +557,7 @@ def make_livecd(opts, mount_dir, work_dir):
remove(fullpath)
shutil.copytree(configdir, fullpath)
isolabel = opts.volid or "{0.name} {0.version} {1.basearch}".format(product, arch)
isolabel = opts.volid or "{0.name}-{0.version}-{1.basearch}".format(product, arch)
if len(isolabel) > 32:
isolabel = isolabel[:32]
log.warn("Truncating isolabel to 32 chars: %s", isolabel)