示例#1
0
文件: Proxy.py 项目: AgarFu/bcfg2
 def __call__(self, *args):
     for retry in range(self.max_retries):
         try:
             return _Method.__call__(self, *args)
         except xmlrpclib.ProtocolError, err:
             self.log.error("Server failure: Protocol Error: %s %s" % \
                           (err.errcode, err.errmsg))
             raise xmlrpclib.Fault(20, "Server Failure")
         except xmlrpclib.Fault:
             raise
示例#2
0
 def __call__(self, *args):
     #print "In Retry Version"
     for retry in range(self.max_retries):
         try:
             retval = _Method.__call__(self, *args)
             #print "returned: retval = %s" % retval
             return retval 
         except xmlrpclib.ProtocolError, err:
             log.error("Server failure: Protocol Error: %s %s" % \
                           (err.errcode, err.errmsg))
             raise xmlrpclib.Fault(20, "Server Failure")
         except xmlrpclib.Fault as fault:
             raise
示例#3
0
 def __call__(self, *args):
     max_retries = 4
     for retry in range(max_retries):
         try:
             return _Method.__call__(self, *args)
         except xmlrpclib.ProtocolError:
             log.error("Server failure: Protocol Error")
             raise xmlrpclib.Fault(20, "Server Failure")
         except socket.error, (err, msg):
             if retry == 3:
                 log.error("Server failure: %s" % msg)
                 raise xmlrpclib.Fault(20, msg)
         except tlslite.errors.TLSError, err:
             log.error("Unexpected TLS Error: %s. Retrying" % \
                       (err.args[0]))