]> xenbits.xensource.com Git - xen.git/commitdiff
pyrgrub: cope with configurations with set default="${saved_entry}" line
authorMichael Young <m.a.young@durham.ac.uk>
Tue, 25 Oct 2011 18:21:05 +0000 (19:21 +0100)
committerMichael Young <m.a.young@durham.ac.uk>
Tue, 25 Oct 2011 18:21:05 +0000 (19:21 +0100)
Fedora 16 grub2 configuration file can have lines like
    set default="${saved_entry}"
and a string containing an integer is expected

Signed-off-by: Michael Young <m.a.young@durham.ac.uk>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
tools/pygrub/src/GrubConf.py

index a31e30a46f76bd3bf93bf49dc865d34beea5132b..c4f543d1963e8bd6cd692d237fef82031d965990 100644 (file)
@@ -425,6 +425,8 @@ class Grub2ConfigFile(_GrubConfigFile):
                 
             if self.commands.has_key(com):
                 if self.commands[com] is not None:
+                    if arg.strip() == "${saved_entry}":
+                        arg = "0"
                     setattr(self, self.commands[com], arg.strip())
                 else:
                     logging.info("Ignored directive %s" %(com,))