[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] pygrub: extlinux parsing correctness

# HG changeset patch
# User Roger Pau Monne <roger.pau@xxxxxxxxxxxxx>
# Date 1328539206 -3600
# Node ID 67d41a95b5a77b91b16acfe6f4540aa487b57f5d
# Parent  9e2f11af4f13e24b1bc4daab2067417d1874f4a9
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 <roger.pau@xxxxxxxxxxxxx>

diff -r 9e2f11af4f13 -r 67d41a95b5a7 tools/pygrub/src/ExtLinuxConf.py
--- a/tools/pygrub/src/ExtLinuxConf.py  Mon Feb 06 12:29:59 2012 +0100
+++ b/tools/pygrub/src/ExtLinuxConf.py  Mon Feb 06 15:40:06 2012 +0100
@@ -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:

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.