pygrub: Fix Grub2 support for Ubuntu 10.04
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 15 Apr 2010 16:36:55 +0000 (17:36 +0100)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 15 Apr 2010 16:36:55 +0000 (17:36 +0100)
Due to changes in grub2, menu entry titles now have single quote
around them rather than double quotes, but the memtest entries still
are using double quotes, so we need to catch both.

Signed-off-by: David Markey <david.markey@citrix.com>
tools/pygrub/src/GrubConf.py

index c03f374156068eae9793f8bab4721e4fa016aaf6..51d0c17a4e367ce1c8f663158073eeb3877a55fb 100644 (file)
@@ -379,7 +379,7 @@ class Grub2ConfigFile(_GrubConfigFile):
                 continue
 
             # new image
-            title_match = re.match('^menuentry "(.*)" (.*){', l)
+            title_match = re.match('^menuentry ["\'](.*)["\'] (.*){', l)
             if title_match:
                 if img is not None:
                     raise RuntimeError, "syntax error: cannot nest menuentry (%d %s)" % (len(img),img)