direct-io.hg

changeset 11643:98c369711006

[XM] Remove traceback printing from load/makepolicy.py.

Should pass the exception along to xm/main.py to handle properly like
the rest of the commands.

Signed-off-by: Alastair Tse <atse@xensource.com>
author atse@norwich.uk.xensource.com
date Thu Sep 28 12:29:52 2006 +0100 (2006-09-28)
parents 98ba161961b5
children 3dea280880e2
files tools/python/xen/xm/loadpolicy.py tools/python/xen/xm/makepolicy.py
line diff
     1.1 --- a/tools/python/xen/xm/loadpolicy.py	Thu Sep 28 12:23:21 2006 +0100
     1.2 +++ b/tools/python/xen/xm/loadpolicy.py	Thu Sep 28 12:29:52 2006 +0100
     1.3 @@ -31,15 +31,12 @@ def main(argv):
     1.4      if len(argv) != 2:
     1.5          raise OptionError('No policy defined')
     1.6      
     1.7 -    try:
     1.8 -        load_policy(argv[1])
     1.9 -
    1.10 -    except ACMError:
    1.11 -        sys.exit(-1)
    1.12 -    except:
    1.13 -        traceback.print_exc(limit = 1)
    1.14 +    load_policy(argv[1])
    1.15  
    1.16  if __name__ == '__main__':
    1.17 -    main(sys.argv)
    1.18 -
    1.19 -
    1.20 +    try:
    1.21 +        main(sys.argv)
    1.22 +    except Exception, e:
    1.23 +        sys.stderr.write('Error: %s\n' % str(e))
    1.24 +        sys.exit(-1)
    1.25 +        
     2.1 --- a/tools/python/xen/xm/makepolicy.py	Thu Sep 28 12:23:21 2006 +0100
     2.2 +++ b/tools/python/xen/xm/makepolicy.py	Thu Sep 28 12:29:52 2006 +0100
     2.3 @@ -33,16 +33,13 @@ def main(argv):
     2.4      if len(argv) != 2:
     2.5          raise OptionError('No XML policy file specified')
     2.6  
     2.7 +    make_policy(argv[1])
     2.8 +
     2.9 +if __name__ == '__main__':
    2.10      try:
    2.11 -        make_policy(argv[1])
    2.12 -    except ACMError:
    2.13 -        sys.exit(-1)
    2.14 -    except:
    2.15 -        traceback.print_exc(limit=1)
    2.16 +        main(sys.argv)
    2.17 +    except Exception, e:
    2.18 +        sys.stderr.write('Error: %s\n' % str(e))
    2.19          sys.exit(-1)
    2.20  
    2.21  
    2.22 -if __name__ == '__main__':
    2.23 -    main(sys.argv)
    2.24 -
    2.25 -