ia64/xen-unstable

changeset 13082:469478194aef

Fix _login to pass arguments to the server unconditionally, rather than
requiring precisely two on the client-side.

Signed-off-by: Ewan Mellor <ewan@xensource.com>
author Ewan Mellor <ewan@xensource.com>
date Mon Dec 18 00:14:40 2006 +0000 (2006-12-18)
parents d7150286ca7b
children 6e68e8a8cc99 8752418b58d8
files tools/python/xen/xm/XenAPI.py
line diff
     1.1 --- a/tools/python/xen/xm/XenAPI.py	Mon Dec 18 00:07:55 2006 +0000
     1.2 +++ b/tools/python/xen/xm/XenAPI.py	Mon Dec 18 00:14:40 2006 +0000
     1.3 @@ -84,23 +84,23 @@ class Session(xen.util.xmlrpclib2.Server
     1.4  
     1.5      def xenapi_request(self, methodname, params):
     1.6          if methodname.startswith('login'):
     1.7 -            self._login(methodname, *params)
     1.8 +            self._login(methodname, params)
     1.9              return None
    1.10          else:
    1.11              full_params = (self._session,) + params
    1.12              return _parse_result(getattr(self, methodname)(*full_params))
    1.13  
    1.14  
    1.15 -    def _login(self, method, username, password):
    1.16 +    def _login(self, method, params):
    1.17          self._session = _parse_result(
    1.18 -            getattr(self, 'session.%s' % method)(username, password))
    1.19 +            getattr(self, 'session.%s' % method)(*params))
    1.20  
    1.21  
    1.22      def __getattr__(self, name):
    1.23          if name == 'xenapi':
    1.24              return _Dispatcher(self.xenapi_request, None)
    1.25          elif name.startswith('login'):
    1.26 -            return lambda u, p: self._login(name, u, p)
    1.27 +            return lambda *params: self._login(name, params)
    1.28          else:
    1.29              return xen.util.xmlrpclib2.ServerProxy.__getattr__(self, name)
    1.30