I found a small bug in xenmon. Even if I gave xenmon a wrong
authorEwan Mellor <ewan@xensource.com>
Thu, 2 Nov 2006 23:01:32 +0000 (23:01 +0000)
committerEwan Mellor <ewan@xensource.com>
Thu, 2 Nov 2006 23:01:32 +0000 (23:01 +0000)
parameter, xenmon did not become an error.

This patch adds a checking of wrong parameter into xenmon.
If wrong parameter is given, xenmon shows the following error
messages.

usage: xenmon.py [options]

xenmon.py: error: No parameter required

Signed-off-by: Masaki Kanno <kanno.masaki@jp.fujitsu.com>
tools/xenmon/xenmon.py

index e6b8ce9e242b06d78289a09ec871060cb5f2c233..d828834a10aafa1f48f8f37b41efe56d8616a272 100644 (file)
@@ -653,7 +653,6 @@ def writelog():
 # start xenbaked
 def start_xenbaked():
     global options
-    global args
     
     os.system("killall -9 xenbaked")
     # assumes that xenbaked is in your path
@@ -672,6 +671,9 @@ def main():
 
     parser = setup_cmdline_parser()
     (options, args) = parser.parse_args()
+
+    if len(args):
+        parser.error("No parameter required")
     if options.mspersample < 0:
         parser.error("option --ms_per_sample: invalid negative value: '%d'" %
                      options.mspersample)