ia64/xen-unstable

view tools/python/xen/xend/XendError.py @ 9450:33df7d4eff23

1) Introduce new exception type XendInvalidDomain that maps to the high level
XEND_INVALID_DOMAIN faultType.
2) Fix exception logic in XMLRPCServer
3) Fix TCP server
4) Remove catching of ProtocolError in main.py. ProtocolErrors only occur
when there is an exception in the exception handling code which shouldn't
ever happen. I've reproduced the error cases described by Ewan with
xend_domain_setTargetMemory and once I fixed the exception logic, I get a
normal faultType of 1 as would be expected.

Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
author anthony@rhesis.austin.ibm.com
date Fri Mar 24 14:31:12 2006 +0100 (2006-03-24)
parents da24df1ea484
children ddcf2632f448
line source
1 #============================================================================
2 # This library is free software; you can redistribute it and/or
3 # modify it under the terms of version 2.1 of the GNU Lesser General Public
4 # License as published by the Free Software Foundation.
5 #
6 # This library is distributed in the hope that it will be useful,
7 # but WITHOUT ANY WARRANTY; without even the implied warranty of
8 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9 # Lesser General Public License for more details.
10 #
11 # You should have received a copy of the GNU Lesser General Public
12 # License along with this library; if not, write to the Free Software
13 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
14 #============================================================================
15 # Copyright (C) 2004, 2005 Mike Wray <mike.wray@hp.com>
16 #============================================================================
18 from xmlrpclib import Fault
20 import XendClient
22 class XendInvalidDomain(Fault):
23 def __init__(self, value):
24 Fault.__init__(self, XendClient.ERROR_INVALID_DOMAIN, value)
26 class XendError(Fault):
28 def __init__(self, value):
29 Fault.__init__(self, XendClient.ERROR_GENERIC, value)
30 self.value = value
32 def __str__(self):
33 return self.value
35 class VmError(XendError):
36 """Vm construction error."""
38 pass