pygrub: extlinux parsing correctness
PATCH 1/1 pygrub: extlinux parsing correctness
# HG changeset patch
# User Roger Pau Monne <[email protected]> # 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.
tools/pygrub/src/ExtLinuxConf.py +1 -1
@@ -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:
Roger Pau Monne writes ("[Xen-devel] [PATCH] pygrub: extlinux parsing correctness"):
Quoted 9 lines
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 <[email protected]>