|
|
886e707 |
diff -up xen-3.1.0-src/tools/pygrub/src/GrubConf.py.noexec xen-3.1.0-src/tools/pygrub/src/GrubConf.py
|
|
|
886e707 |
--- xen-3.1.0-src/tools/pygrub/src/GrubConf.py.noexec 2007-09-25 15:20:14.000000000 -0400
|
|
|
886e707 |
+++ xen-3.1.0-src/tools/pygrub/src/GrubConf.py 2007-09-25 15:20:25.000000000 -0400
|
|
|
886e707 |
@@ -101,7 +101,7 @@ class GrubImage(object):
|
|
|
886e707 |
|
|
|
886e707 |
if self.commands.has_key(com):
|
|
|
886e707 |
if self.commands[com] is not None:
|
|
|
886e707 |
- exec("%s = r\"%s\"" %(self.commands[com], arg.strip()))
|
|
|
886e707 |
+ setattr(self, self.commands[com], arg.strip())
|
|
|
886e707 |
else:
|
|
|
886e707 |
logging.info("Ignored image directive %s" %(com,))
|
|
|
886e707 |
else:
|
|
|
886e707 |
@@ -142,11 +142,11 @@ class GrubImage(object):
|
|
|
886e707 |
initrd = property(get_initrd, set_initrd)
|
|
|
886e707 |
|
|
|
886e707 |
# set up command handlers
|
|
|
886e707 |
- commands = { "title": "self.title",
|
|
|
886e707 |
- "root": "self.root",
|
|
|
886e707 |
- "rootnoverify": "self.root",
|
|
|
886e707 |
- "kernel": "self.kernel",
|
|
|
886e707 |
- "initrd": "self.initrd",
|
|
|
886e707 |
+ commands = { "title": "title",
|
|
|
886e707 |
+ "root": "root",
|
|
|
886e707 |
+ "rootnoverify": "root",
|
|
|
886e707 |
+ "kernel": "kernel",
|
|
|
886e707 |
+ "initrd": "initrd",
|
|
|
886e707 |
"chainloader": None,
|
|
|
886e707 |
"module": None}
|
|
|
886e707 |
|
|
|
886e707 |
@@ -195,7 +195,7 @@ class GrubConfigFile(object):
|
|
|
886e707 |
(com, arg) = grub_exact_split(l, 2)
|
|
|
886e707 |
if self.commands.has_key(com):
|
|
|
886e707 |
if self.commands[com] is not None:
|
|
|
886e707 |
- exec("%s = r\"%s\"" %(self.commands[com], arg.strip()))
|
|
|
886e707 |
+ setattr(self, self.commands[com], arg.strip())
|
|
|
886e707 |
else:
|
|
|
886e707 |
logging.info("Ignored directive %s" %(com,))
|
|
|
886e707 |
else:
|
|
|
886e707 |
@@ -208,7 +208,7 @@ class GrubConfigFile(object):
|
|
|
886e707 |
(com, arg) = grub_exact_split(line, 2)
|
|
|
886e707 |
if self.commands.has_key(com):
|
|
|
886e707 |
if self.commands[com] is not None:
|
|
|
886e707 |
- exec("%s = r\"%s\"" %(self.commands[com], arg.strip()))
|
|
|
886e707 |
+ setattr(self, self.commands[com], arg.strip())
|
|
|
886e707 |
else:
|
|
|
886e707 |
logging.info("Ignored directive %s" %(com,))
|
|
|
886e707 |
else:
|
|
|
886e707 |
@@ -236,12 +236,12 @@ class GrubConfigFile(object):
|
|
|
886e707 |
splash = property(get_splash, set_splash)
|
|
|
886e707 |
|
|
|
886e707 |
# set up command handlers
|
|
|
886e707 |
- commands = { "default": "self.default",
|
|
|
886e707 |
- "timeout": "self.timeout",
|
|
|
886e707 |
- "fallback": "self.fallback",
|
|
|
886e707 |
- "hiddenmenu": "self.hiddenmenu",
|
|
|
886e707 |
- "splashimage": "self.splash",
|
|
|
886e707 |
- "password": "self.password" }
|
|
|
886e707 |
+ commands = { "default": "default",
|
|
|
886e707 |
+ "timeout": "timeout",
|
|
|
886e707 |
+ "fallback": "fallback",
|
|
|
886e707 |
+ "hiddenmenu": "hiddenmenu",
|
|
|
886e707 |
+ "splashimage": "splash",
|
|
|
886e707 |
+ "password": "password" }
|
|
|
886e707 |
for c in ("bootp", "color", "device", "dhcp", "hide", "ifconfig",
|
|
|
886e707 |
"pager", "partnew", "parttype", "rarp", "serial",
|
|
|
886e707 |
"setkey", "terminal", "terminfo", "tftpserver", "unhide"):
|
|
|
886e707 |
diff -up xen-3.1.0-src/tools/pygrub/src/LiloConf.py.noexec xen-3.1.0-src/tools/pygrub/src/LiloConf.py
|
|
|
886e707 |
--- xen-3.1.0-src/tools/pygrub/src/LiloConf.py.noexec 2007-09-25 15:20:18.000000000 -0400
|
|
|
886e707 |
+++ xen-3.1.0-src/tools/pygrub/src/LiloConf.py 2007-09-25 15:20:23.000000000 -0400
|
|
|
886e707 |
@@ -30,7 +30,7 @@ class LiloImage(object):
|
|
|
886e707 |
|
|
|
886e707 |
if self.commands.has_key(com):
|
|
|
886e707 |
if self.commands[com] is not None:
|
|
|
886e707 |
- exec("%s = r\'%s\'" %(self.commands[com], re.sub('^"(.+)"$', r"\1", arg.strip())))
|
|
|
886e707 |
+ setattr(self, self.commands[com], re.sub('^"(.+)"$', r"\1", arg.strip()))
|
|
|
886e707 |
else:
|
|
|
886e707 |
logging.info("Ignored image directive %s" %(com,))
|
|
|
886e707 |
else:
|
|
|
886e707 |
@@ -56,12 +56,12 @@ class LiloImage(object):
|
|
|
886e707 |
initrd = property(get_initrd, set_initrd)
|
|
|
886e707 |
|
|
|
886e707 |
# set up command handlers
|
|
|
886e707 |
- commands = { "label": "self.title",
|
|
|
886e707 |
- "root": "self.root",
|
|
|
886e707 |
- "rootnoverify": "self.root",
|
|
|
886e707 |
- "image": "self.kernel",
|
|
|
886e707 |
- "initrd": "self.initrd",
|
|
|
886e707 |
- "append": "self.args",
|
|
|
886e707 |
+ commands = { "label": "title",
|
|
|
886e707 |
+ "root": "root",
|
|
|
886e707 |
+ "rootnoverify": "root",
|
|
|
886e707 |
+ "image": "kernel",
|
|
|
886e707 |
+ "initrd": "initrd",
|
|
|
886e707 |
+ "append": "args",
|
|
|
886e707 |
"read-only": None,
|
|
|
886e707 |
"chainloader": None,
|
|
|
886e707 |
"module": None}
|
|
|
886e707 |
@@ -111,7 +111,7 @@ class LiloConfigFile(object):
|
|
|
886e707 |
(com, arg) = GrubConf.grub_exact_split(l, 2)
|
|
|
886e707 |
if self.commands.has_key(com):
|
|
|
886e707 |
if self.commands[com] is not None:
|
|
|
886e707 |
- exec("%s = r\"%s\"" %(self.commands[com], arg.strip()))
|
|
|
886e707 |
+ setattr(self, self.commands[com], arg.strip())
|
|
|
886e707 |
else:
|
|
|
886e707 |
logging.info("Ignored directive %s" %(com,))
|
|
|
886e707 |
else:
|