def completed_step(self, id, phase, stdout, stderr, exitcode): try: method = get_dlp_method(phase) except KeyError: logging.getLogger().warn("Method %s not declared" % phase) return False else: return xmlrpcCleanup(MscDispatcher().run_proxymethod( "dlp", id, method, (exitcode, stdout, stderr), True))
def completed_step(self, id, phase, stdout, stderr, exitcode): try: method = get_dlp_method(phase) except KeyError: logging.getLogger().warn("Method %s not declared" % phase) return False else : return xmlrpcCleanup(MscDispatcher().run_proxymethod("dlp", id, method, (exitcode, stdout, stderr), True ))
def _cbRender(self, result, request, func, args): if isinstance(result, ForwardingProxy): result = xmlrpcCleanup(result.result) if not isinstance(result, xmlrpclib.Fault): result = (result, ) self.logger.debug('xmlrpc: %s%s => %s' % (func, (args), (result))) try: s = xmlrpclib.dumps(result, methodresponse=1) except: f = xmlrpclib.Fault(self.FAILURE, "can't serialize output") s = xmlrpclib.dumps(f, methodresponse=1) request.setHeader("content-length", str(len(s))) try: request.write(s) if not request.finished: request.finish() except Exception, e: self.logger.debug("XMLRPC Proxy : request finish: %s" % str(e))
def _cbRender(self, result, request, func, args): if isinstance(result, ForwardingProxy): result = xmlrpcCleanup(result.result) if not isinstance(result, xmlrpclib.Fault): result = (result,) self.logger.debug('xmlrpc: %s%s => %s' % (func, (args), (result))) try: s = xmlrpclib.dumps(result, methodresponse=1) except: f = xmlrpclib.Fault(self.FAILURE, "can't serialize output") s = xmlrpclib.dumps(f, methodresponse=1) request.setHeader("content-length", str(len(s))) try: request.write(s) if not request.finished : request.finish() except Exception, e : self.logger.debug("XMLRPC Proxy : request finish: %s" % str(e))