ia64/xen-unstable

changeset 4096:6cf7424f52f1

bitkeeper revision 1.1159.265.3 (42319571gIMQdofIDztktCfg053n-A)

Fix some errors in default error handling.

Signed-off-by: Mike Wray <mike.wray@hp.com>
author mjw@wray-m-3.hpl.hp.com
date Fri Mar 11 12:56:17 2005 +0000 (2005-03-11)
parents 2f9077bf40da
children 552e3748f0e7
files tools/python/xen/xend/Args.py tools/python/xen/xend/server/SrvBase.py tools/python/xen/xend/server/SrvDir.py
line diff
     1.1 --- a/tools/python/xen/xend/Args.py	Fri Mar 11 12:54:24 2005 +0000
     1.2 +++ b/tools/python/xen/xend/Args.py	Fri Mar 11 12:56:17 2005 +0000
     1.3 @@ -78,6 +78,8 @@ class Args:
     1.4                  val = str(v)
     1.5              elif type == 'sxpr':
     1.6                  val = self.sxpr(v)
     1.7 +            elif type == 'bool':
     1.8 +                val = self.bool(v)
     1.9              else:
    1.10                  raise ArgError('invalid type:' + str(type))
    1.11              return val
    1.12 @@ -86,6 +88,9 @@ class Args:
    1.13          except StandardError, ex:
    1.14              raise ArgError(str(ex))
    1.15  
    1.16 +    def bool(self, v):
    1.17 +        return (v.lower() in ['on', 'yes', '1', 'true'])
    1.18 +
    1.19      def sxpr(self, v):
    1.20          if isinstance(v, types.ListType):
    1.21              val = v
     2.1 --- a/tools/python/xen/xend/server/SrvBase.py	Fri Mar 11 12:54:24 2005 +0000
     2.2 +++ b/tools/python/xen/xend/server/SrvBase.py	Fri Mar 11 12:56:17 2005 +0000
     2.3 @@ -106,7 +106,8 @@ class SrvBase(resource.Resource):
     2.4          try:
     2.5              val = op_method(op, req)
     2.6          except Exception, err:
     2.7 -            return self._perform_err(err, op, req)
     2.8 +            self._perform_err(err, op, req)
     2.9 +            return ''
    2.10              
    2.11          if isinstance(val, defer.Deferred):
    2.12              val.addCallback(self._perform_cb, op, req, dfr=1)
     3.1 --- a/tools/python/xen/xend/server/SrvDir.py	Fri Mar 11 12:54:24 2005 +0000
     3.2 +++ b/tools/python/xen/xend/server/SrvDir.py	Fri Mar 11 12:56:17 2005 +0000
     3.3 @@ -88,7 +88,7 @@ class SrvDir(SrvBase):
     3.4                  req.write('</body></html>')
     3.5              return ''
     3.6          except Exception, ex:
     3.7 -            self._perform_err(ex, req)
     3.8 +            self._perform_err(ex, "GET", req)
     3.9              
    3.10      def ls(self, req, use_sxp=0):
    3.11          url = req.prePathURL()