def InvokeAccessor(self, mo, info):
# This retry logic is replicated in InvokeMethod and the two copies need
# to be in sync
retriesLeft = self.retryCount
while retriesLeft > 0:
try:
if self.state == self.STATE_UNAUTHENTICATED:
self._CallLoginMethod()
# Invoke the method
obj = StubAdapterBase.InvokeAccessor(self, mo, info)
except (socket.error, http_client.HTTPException, ExpatError):
if self.retryDelay and retriesLeft:
time.sleep(self.retryDelay)
retriesLeft -= 1
continue
except Exception as e:
if isinstance(e, self.SESSION_EXCEPTIONS):
# Our session might've timed out, change our state and retry.
self._SetStateUnauthenticated()
else:
raise e
return obj
# Raise any socket/httplib errors caught above.
raise SystemError()
## Handle the login method call
#
# This method calls the login method on the soap stub and changes the state
# to authenticated
评论列表
文章目录