ia64/xen-unstable

changeset 9426:c1bb4eb56529

Added exception handler for ProtocolError.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author emellor@leeni.uk.xensource.com
date Thu Mar 23 11:58:19 2006 +0100 (2006-03-23)
parents b55ca95fdc84
children da24df1ea484
files tools/python/xen/xm/main.py
line diff
     1.1 --- a/tools/python/xen/xm/main.py	Thu Mar 23 11:55:56 2006 +0100
     1.2 +++ b/tools/python/xen/xm/main.py	Thu Mar 23 11:58:19 2006 +0100
     1.3 @@ -1102,6 +1102,12 @@ def main(argv=sys.argv):
     1.4              else:
     1.5                  err("Error connecting to xend: %s." % ex[1])
     1.6              sys.exit(1)
     1.7 +        except xmlrpclib.ProtocolError, ex:
     1.8 +            if os.geteuid() != 0:
     1.9 +                err("Most commands need root access.  Please try again as root.")
    1.10 +            else:
    1.11 +                err("Error connecting to xend: %s." % ex.errmsg)
    1.12 +            sys.exit(1)
    1.13          except SystemExit:
    1.14              sys.exit(1)
    1.15          except xmlrpclib.Fault, ex: