aboutsummaryrefslogtreecommitdiffstats
path: root/tools/pygrub/src/GrubConf.py
diff options
context:
space:
mode:
authorMatthew Daley <mattjd@gmail.com>2012-11-12 17:03:21 +0000
committerMatthew Daley <mattjd@gmail.com>2012-11-12 17:03:21 +0000
commit0c6601ee18c664a8702c142bd901ebc9539ac48d (patch)
tree22e3b102c4cbd9cbb9a88a49db71fe296f6bb3a0 /tools/pygrub/src/GrubConf.py
parentc61788c33886f8708bf30337b5e460678037cae9 (diff)
downloadxen-0c6601ee18c664a8702c142bd901ebc9539ac48d.tar.gz
xen-0c6601ee18c664a8702c142bd901ebc9539ac48d.tar.bz2
xen-0c6601ee18c664a8702c142bd901ebc9539ac48d.zip
pygrub: Fix command line argument error handling
pygrub's individual config file parsers do not correctly check the amount of command line arguments given to them. In addition, the LILO config parser would report an incorrect message. Use len() to correctly check the amount of arguments, and fix the LILO error message. Signed-off-by: Matthew Daley <mattjd@gmail.com> Acked-by: Ian Campbell <ian.campbell@citrix.com> Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/pygrub/src/GrubConf.py')
-rw-r--r--tools/pygrub/src/GrubConf.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/pygrub/src/GrubConf.py b/tools/pygrub/src/GrubConf.py
index c4f543d196..629951f941 100644
--- a/tools/pygrub/src/GrubConf.py
+++ b/tools/pygrub/src/GrubConf.py
@@ -454,7 +454,7 @@ class Grub2ConfigFile(_GrubConfigFile):
}
if __name__ == "__main__":
- if sys.argv < 3:
+ if len(sys.argv) < 3:
raise RuntimeError, "Need a grub version (\"grub\" or \"grub2\") and a grub.conf or grub.cfg to read"
if sys.argv[1] == "grub":
g = GrubConfigFile(sys.argv[2])