ia64/xen-unstable

changeset 1852:31198bacfb3d

bitkeeper revision 1.1108.1.6 (40fe62673yjDDWr_lJLCZV970Wralw)

Fix problem with POST - need Content-Length header.
author mjw@wray-m-3.hpl.hp.com
date Wed Jul 21 12:32:39 2004 +0000 (2004-07-21)
parents fd5d2b14cf2a
children ba57d25bfe88
files tools/python/xen/xend/XendClient.py
line diff
     1.1 --- a/tools/python/xen/xend/XendClient.py	Wed Jul 21 11:30:34 2004 +0000
     1.2 +++ b/tools/python/xen/xend/XendClient.py	Wed Jul 21 12:32:39 2004 +0000
     1.3 @@ -236,6 +236,8 @@ class AsynchXendClient(http.HTTPClient):
     1.4          self.sendHeader('Host', url.location())
     1.5          for (k, v) in request.headers.items():
     1.6              self.sendHeader(k, v)
     1.7 +        if request.data:
     1.8 +            self.sendHeader('Content-Length', len(request.data))
     1.9          self.endHeaders()
    1.10          if request.data:
    1.11              self.transport.write(request.data)
    1.12 @@ -517,22 +519,6 @@ class Xend:
    1.13          return self.xendGet(self.dmesgurl())
    1.14      
    1.15  
    1.16 -def synchmain(srv, argv):
    1.17 -    xend = Xend(srv=srv)
    1.18 -    if len(argv) > 1:
    1.19 -        fn = argv[0]
    1.20 -    else:
    1.21 -        fn = 'xend'
    1.22 -    if not fn.startswith('xend'):
    1.23 -        fn = 'xend_' + fn
    1.24 -    args = argv[1:]
    1.25 -    try:
    1.26 -        val = getattr(xend, fn)(*args)
    1.27 -        PrettyPrint.prettyprint(val)
    1.28 -    except XendError, err:
    1.29 -        print 'ERROR:', err
    1.30 -        sys.exit(1)
    1.31 -
    1.32  def xendmain(srv, asynch, fn, args):
    1.33      if asynch:
    1.34          client = AsynchXendClientProtocol()
    1.35 @@ -586,7 +572,7 @@ def main(argv):
    1.36              srv = v
    1.37          elif k in ['-a', '--asynch']:
    1.38              asynch = 1
    1.39 -        elif k in ['-d', '--DEBUG']:
    1.40 +        elif k in ['-d', '--debug']:
    1.41              DEBUG = 1
    1.42      if len(args):
    1.43          fn = args[0]