1 from Ganga.GPIDev.Adapters.IMonitoringService import IMonitoringService
2
4 """ A very simple debugging tool: in case of application failure, the stdout and stderr is sent back to the xmlrpm server on the client. This assumes that the stderr and stdout files are produced in CWD. Reliability of this mechanism depends on the network configuration (firewalls etc). Unless environment variable GANGA_OUTPUTSERVERMS_URL is defined, the server on local host on port 8182 is assumed. The variable GANGA_OUTPUTSERVERMS_URL should be of form: http://host.name:port.
5 """
8
9 - def stop(self,exitcode,*other):
10 if exitcode:
11 def send_file(name):
12 try:
13 import xmlrpclib
14 s = xmlrpclib.ServerProxy(self.job_info['server_url'])
15 s.send_output(self.job_info['jobid'],name,file(name,'r').read())
16 except Exception,x:
17 import sys
18 print >> sys.stderr, 'OutputServerMS exception raised while sending "%s": %s'%(name,str(x))
19 import traceback
20 traceback.print_exc()
21
22 send_file('stderr')
23 send_file('stdout')
24
36
41