[Xen-devel] [PATCH] Fix TypeError when calling get_last_updated api call

Ruben Kerkhof
Sat, 08 Aug 2009 12:59:18 -0000

# HG changeset patch
# User Ruben Kerkhof <ruben@tilaa.nl>
# Date 1249736218 -7200
# Node ID 7bc1e6403b776b4040560525e986960c283d8b73
# Parent  b9cdcf502aa35818581d41cee7e6e30ae49acb92
Fix TypeError when calling get_last_updated api call

get_last_updated returns a DateTime and cannot be compared to
_RECONNECT_AND_RETRY

diff --git a/tools/python/xen/xm/XenAPI.py b/tools/python/xen/xm/
XenAPI.py
--- a/tools/python/xen/xm/XenAPI.py
+++ b/tools/python/xen/xm/XenAPI.py
@@ -140,7 +140,7 @@ class Session(xmlrpcclient.ServerProxy):
              while retry_count < 3:
                  full_params = (self._session,) + params
                  result = _parse_result(getattr(self, methodname)
(*full_params))
-                if result == _RECONNECT_AND_RETRY:
+                if str(result) == _RECONNECT_AND_RETRY:
                      retry_count += 1
                      if self.last_login_method:
                          self._login(self.last_login_method,


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com