ia64/xen-unstable

changeset 7198:4c4dbbda367e

Catch xen.xend.XendProtocol.XendError as well as xen.xend.XendError.XendError.
This horror needs cleaning up -- this is just a stopgap.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@ewan
date Tue Oct 04 11:43:38 2005 +0100 (2005-10-04)
parents 5a3d5f9ef44e
children e6303281ca6c
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Tue Oct 04 11:42:06 2005 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Tue Oct 04 11:43:38 2005 +0100
     1.3 @@ -32,6 +32,7 @@ import warnings
     1.4  warnings.filterwarnings('ignore', category=FutureWarning)
     1.5  
     1.6  import xen.xend.XendError
     1.7 +import xen.xend.XendProtocol
     1.8  
     1.9  from xen.xend import PrettyPrint
    1.10  from xen.xend import sxp
    1.11 @@ -710,6 +711,14 @@ def main(argv=sys.argv):
    1.12                  print
    1.13                  print "Please report to xen-devel@lists.xensource.com"
    1.14                  raise
    1.15 +        except xen.xend.XendProtocol.XendError, ex:
    1.16 +            if len(args) > 0:
    1.17 +                handle_xend_error(argv[1], args[0], ex)
    1.18 +            else:
    1.19 +                print "Unexpected error:", sys.exc_info()[0]
    1.20 +                print
    1.21 +                print "Please report to xen-devel@lists.xensource.com"
    1.22 +                raise
    1.23          except SystemExit:
    1.24              sys.exit(1)
    1.25          except: