From c789f20b66f0bf6d3986c272b5330523c2c002bd Mon Sep 17 00:00:00 2001 From: Peter Jones Date: Mon, 30 Jun 2014 16:42:11 -0400 Subject: [PATCH] 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 --- share/live/x86.tmpl | 3 +++ share/x86.tmpl | 3 +++ src/pylorax/__init__.py | 2 +- src/sbin/livemedia-creator | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/share/live/x86.tmpl b/share/live/x86.tmpl index 522c873b..eb67bbf0 100644 --- a/share/live/x86.tmpl +++ b/share/live/x86.tmpl @@ -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} diff --git a/share/x86.tmpl b/share/x86.tmpl index a139596f..cdd74776 100644 --- a/share/x86.tmpl +++ b/share/x86.tmpl @@ -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} diff --git a/src/pylorax/__init__.py b/src/pylorax/__init__.py index 952f08f8..83f5286d 100644 --- a/src/pylorax/__init__.py +++ b/src/pylorax/__init__.py @@ -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: diff --git a/src/sbin/livemedia-creator b/src/sbin/livemedia-creator index 47eec2ce..e5f4f77a 100755 --- a/src/sbin/livemedia-creator +++ b/src/sbin/livemedia-creator @@ -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)