From 8625b8c5a9a51f124c27fc3e51282150f0602198 Mon Sep 17 00:00:00 2001 From: Teo Mrnjavac Date: Thu, 2 Apr 2015 20:25:41 +0200 Subject: [PATCH] Fix up regex in grubcfg to work with single quotes. --- src/modules/grubcfg/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/grubcfg/main.py b/src/modules/grubcfg/main.py index d34f0c257..e7d147caf 100644 --- a/src/modules/grubcfg/main.py +++ b/src/modules/grubcfg/main.py @@ -77,12 +77,14 @@ def modify_grub_default(partitions, root_mount_point, distributor): lines[i] = kernel_cmd have_kernel_cmd = True elif lines[i].startswith("GRUB_CMDLINE_LINUX_DEFAULT"): - regex = re.compile(r"^GRUB_CMDLINE_LINUX_DEFAULT\s*=\s*\"") + regex = re.compile(r"^GRUB_CMDLINE_LINUX_DEFAULT\s*=\s*") line = regex.sub("", lines[i]) line = line.lstrip() line = line.lstrip("\"") + line = line.lstrip("'") line = line.rstrip() line = line.rstrip("\"") + line = line.rstrip("'") existing_params = line.split() for existing_param in existing_params: