ia64/xen-unstable

changeset 12233:7818629c336c

I found a small bug in xenmon. Even if I gave xenmon a wrong
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>
author Ewan Mellor <ewan@xensource.com>
date Thu Nov 02 23:01:32 2006 +0000 (2006-11-02)
parents dd62270df2ad
children 82e3575e7588
files tools/xenmon/xenmon.py
line diff
     1.1 --- a/tools/xenmon/xenmon.py	Thu Nov 02 22:24:20 2006 +0000
     1.2 +++ b/tools/xenmon/xenmon.py	Thu Nov 02 23:01:32 2006 +0000
     1.3 @@ -653,7 +653,6 @@ def writelog():
     1.4  # start xenbaked
     1.5  def start_xenbaked():
     1.6      global options
     1.7 -    global args
     1.8      
     1.9      os.system("killall -9 xenbaked")
    1.10      # assumes that xenbaked is in your path
    1.11 @@ -672,6 +671,9 @@ def main():
    1.12  
    1.13      parser = setup_cmdline_parser()
    1.14      (options, args) = parser.parse_args()
    1.15 +
    1.16 +    if len(args):
    1.17 +        parser.error("No parameter required")
    1.18      if options.mspersample < 0:
    1.19          parser.error("option --ms_per_sample: invalid negative value: '%d'" %
    1.20                       options.mspersample)