ia64/xen-unstable

changeset 13229:974fb31dcbe9

(temporarily) revert cset 13174:766eec31afab since it seems to break 64-bit;
a proper fix will arrive in the new year.

Signed-off-by: Steven Hand <steven@xensource.com>
author Steven Hand <steven@xensource.com>
date Fri Dec 29 18:17:56 2006 +0000 (2006-12-29)
parents baf59a93800f
children 444315d1ca5a
files tools/python/xen/xm/XenAPI.py
line diff
     1.1 --- a/tools/python/xen/xm/XenAPI.py	Fri Dec 29 17:46:40 2006 +0000
     1.2 +++ b/tools/python/xen/xm/XenAPI.py	Fri Dec 29 18:17:56 2006 +0000
     1.3 @@ -50,7 +50,7 @@ import xmlrpclib
     1.4  import xen.util.xmlrpclib2
     1.5  
     1.6  
     1.7 -translation = gettext.translation('xen-xm')
     1.8 +gettext.install('xen-xm')
     1.9  
    1.10  class Failure(Exception):
    1.11      def __init__(self, details):
    1.12 @@ -68,7 +68,7 @@ class Failure(Exception):
    1.13  
    1.14      def __str__(self):
    1.15          try:
    1.16 -            return translation.ugettext(self.details[0]) % self._details_map()
    1.17 +            return _(self.details[0]) % self._details_map()
    1.18          except TypeError, exn:
    1.19              return "Message database broken: %s.\nXen-API failure: %s" % \
    1.20                     (exn, str(self.details))
    1.21 @@ -108,8 +108,6 @@ class Session(xen.util.xmlrpclib2.Server
    1.22                                                   encoding, verbose,
    1.23                                                   allow_none)
    1.24          self._session = None
    1.25 -        self.last_login_method = None
    1.26 -        self.last_login_params = None
    1.27  
    1.28  
    1.29      def xenapi_request(self, methodname, params):
    1.30 @@ -123,11 +121,7 @@ class Session(xen.util.xmlrpclib2.Server
    1.31                  result = _parse_result(getattr(self, methodname)(*full_params))
    1.32                  if result == _RECONNECT_AND_RETRY:
    1.33                      retry_count += 1
    1.34 -                    if self.last_login_method:
    1.35 -                        self._login(self.last_login_method,
    1.36 -                                    self.last_login_params)
    1.37 -                    else:
    1.38 -                        raise xmlrpclib.Fault(401, 'You must log in')
    1.39 +                    self._login(self.last_login_method, self.last_login_params)
    1.40                  else:
    1.41                      return result
    1.42              raise xmlrpclib.Fault(
    1.43 @@ -178,18 +172,10 @@ class _Dispatcher:
    1.44      def __init__(self, send, name):
    1.45          self.__send = send
    1.46          self.__name = name
    1.47 -
    1.48 -    def __repr__(self):
    1.49 -        if self.__name:
    1.50 -            return '<XenAPI._Dispatcher for %s>' % self.__name
    1.51 -        else:
    1.52 -            return '<XenAPI._Dispatcher>'
    1.53 -
    1.54      def __getattr__(self, name):
    1.55          if self.__name is None:
    1.56              return _Dispatcher(self.__send, name)
    1.57          else:
    1.58              return _Dispatcher(self.__send, "%s.%s" % (self.__name, name))
    1.59 -
    1.60      def __call__(self, *args):
    1.61          return self.__send(self.__name, args)