From 7af6c7ad830ede5b9aad3fe58140e3f0aa0787af Mon Sep 17 00:00:00 2001 From: Roger Pau Monne Date: Tue, 7 Feb 2012 17:21:27 +0000 Subject: pygrub: extlinux parsing correctness The "in" operator should be used instead of the find method, since we are only interested in knowing whether the line contains "initrd=", but we don't care about it's position. Also fixes an error that happens when initrd= it's at the start of the line, since find returns 0 and is evaluated as False. Signed-off-by: Roger Pau Monne Acked-by: Ian Jackson Committed-by: Ian Jackson --- tools/pygrub/src/ExtLinuxConf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/pygrub') diff --git a/tools/pygrub/src/ExtLinuxConf.py b/tools/pygrub/src/ExtLinuxConf.py index 9d77b9f9bb..19776a3c92 100644 --- a/tools/pygrub/src/ExtLinuxConf.py +++ b/tools/pygrub/src/ExtLinuxConf.py @@ -60,7 +60,7 @@ class ExtLinuxImage(object): # Bypass regular self.commands handling com = None - elif arg.find("initrd="): + elif "initrd=" in arg: # find initrd image in append line args = arg.strip().split(" ") for a in args: -- cgit v1.2.3