ia64/xen-unstable

changeset 9544:1d0bd5ea2c87

Print error messages to stderr. Remove unused handle_xend_error.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Fri Mar 31 00:14:09 2006 +0100 (2006-03-31)
parents 53ded2201b7f
children 94971fe9c62a
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Fri Mar 31 00:13:33 2006 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Fri Mar 31 00:14:09 2006 +0100
     1.3 @@ -291,18 +291,6 @@ def int_unit(str, dest):
     1.4  def err(msg):
     1.5      print >>sys.stderr, "Error:", msg
     1.6  
     1.7 -def handle_xend_error(cmd, args, ex):
     1.8 -    non_option = filter(lambda x: x[0] != '-', args)
     1.9 -    dom = len(non_option) > 0 and non_option[0] or None
    1.10 -
    1.11 -    error = str(ex)
    1.12 -    if error == "Not found" and dom != None:
    1.13 -        err("Domain '%s' not found when running 'xm %s'" % (dom, cmd))
    1.14 -    else:
    1.15 -        err(error)
    1.16 -
    1.17 -    sys.exit(1)
    1.18 -    
    1.19  
    1.20  #########################################################################
    1.21  #
    1.22 @@ -1106,9 +1094,10 @@ def main(argv=sys.argv):
    1.23              sys.exit(1)
    1.24          except xmlrpclib.Fault, ex:
    1.25              if ex.faultCode == xen.xend.XendClient.ERROR_INVALID_DOMAIN:
    1.26 -                print "Error: the domain '%s' does not exist." % ex.faultString
    1.27 +                print  >>sys.stderr, (
    1.28 +                    "Error: the domain '%s' does not exist." % ex.faultString)
    1.29              else:
    1.30 -                print "Error: %s" % ex.faultString
    1.31 +                print  >>sys.stderr, "Error: %s" % ex.faultString
    1.32              sys.exit(1)
    1.33          except:
    1.34              print "Unexpected error:", sys.exc_info()[0]