def InvokeMethod(self, mo, info, args):
# This retry logic is replicated in InvokeAccessor 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
status, obj = self.soapStub.InvokeMethod(mo, info, args, self)
except (socket.error, http_client.HTTPException, ExpatError):
if self.retryDelay and retriesLeft:
time.sleep(self.retryDelay)
retriesLeft -= 1
continue
if status == 200:
# Normal return from the server, return the object to the caller.
return obj
# An exceptional return from the server
if isinstance(obj, self.SESSION_EXCEPTIONS):
# Our session might've timed out, change our state and retry.
self._SetStateUnauthenticated()
else:
# It's an exception from the method that was called, send it up.
raise obj
# Raise any socket/httplib errors caught above.
raise SystemError()
## Retrieve a managed property
#
# @param self self
# @param mo managed object
# @param info property info
评论列表
文章目录