From: BitKeeper B. <ri...@su...> - 2005-03-13 10:01:32
|
ChangeSet 1.1159.263.3, 2005/03/11 12:56:17+00:00, mj...@wr... Fix some errors in default error handling. Signed-off-by: Mike Wray <mik...@hp...> Args.py | 5 +++++ server/SrvBase.py | 3 ++- server/SrvDir.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff -Nru a/tools/python/xen/xend/Args.py b/tools/python/xen/xend/Args.py --- a/tools/python/xen/xend/Args.py 2005-03-13 05:01:28 -05:00 +++ b/tools/python/xen/xend/Args.py 2005-03-13 05:01:28 -05:00 @@ -78,6 +78,8 @@ val = str(v) elif type == 'sxpr': val = self.sxpr(v) + elif type == 'bool': + val = self.bool(v) else: raise ArgError('invalid type:' + str(type)) return val @@ -85,6 +87,9 @@ raise except StandardError, ex: raise ArgError(str(ex)) + + def bool(self, v): + return (v.lower() in ['on', 'yes', '1', 'true']) def sxpr(self, v): if isinstance(v, types.ListType): diff -Nru a/tools/python/xen/xend/server/SrvBase.py b/tools/python/xen/xend/server/SrvBase.py --- a/tools/python/xen/xend/server/SrvBase.py 2005-03-13 05:01:28 -05:00 +++ b/tools/python/xen/xend/server/SrvBase.py 2005-03-13 05:01:28 -05:00 @@ -106,7 +106,8 @@ try: val = op_method(op, req) except Exception, err: - return self._perform_err(err, op, req) + self._perform_err(err, op, req) + return '' if isinstance(val, defer.Deferred): val.addCallback(self._perform_cb, op, req, dfr=1) diff -Nru a/tools/python/xen/xend/server/SrvDir.py b/tools/python/xen/xend/server/SrvDir.py --- a/tools/python/xen/xend/server/SrvDir.py 2005-03-13 05:01:28 -05:00 +++ b/tools/python/xen/xend/server/SrvDir.py 2005-03-13 05:01:28 -05:00 @@ -88,7 +88,7 @@ req.write('</body></html>') return '' except Exception, ex: - self._perform_err(ex, req) + self._perform_err(ex, "GET", req) def ls(self, req, use_sxp=0): url = req.prePathURL() |