ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/COMP/CRAB/python/PostMortemServer.py
(Generate patch)

Comparing COMP/CRAB/python/PostMortemServer.py (file contents):
Revision 1.6 by spiga, Sun Oct 26 12:49:15 2008 UTC vs.
Revision 1.8 by spiga, Tue May 26 10:23:01 2009 UTC

# Line 35 | Line 35 | class PostMortemServer(PostMortem):
35          try:  
36              seEl = SElement(self.storage_name, self.storage_proto, self.storage_port)
37          except Exception, ex:
38 <            common.logger.debug(1, str(ex))
38 >            common.logger.debug( str(ex))
39              msg = "ERROR: Unable to create SE source interface \n"
40              raise CrabException(msg)
41          try:
42              loc = SElement("localhost", "local")
43          except Exception, ex:
44 <            common.logger.debug(1, str(ex))
44 >            common.logger.debug( str(ex))
45              msg = "ERROR: Unable to create destination interface \n"
46              raise CrabException(msg)
47  
# Line 54 | Line 54 | class PostMortemServer(PostMortem):
54          ## iter over each asked job and print warning if not in skimmed list
55          for id in self.nj_list:
56              if id not in self.all_jobs:
57 <                common.logger.message('Warning: job # ' + str(id) + ' does not exist! Not possible to ask for postMortem ')
57 >                common.logger.info('Warning: job # ' + str(id) + ' does not exist! Not possible to ask for postMortem ')
58                  continue
59              elif id in logginable:  
60                  fname = self.fname_base + str(id) + '.LoggingInfo'
61                  if os.path.exists(fname):
62 <                    common.logger.message('Logging info for job ' + str(id) + ' already present in '+fname+'\nRemove it for update')
62 >                    common.logger.info('Logging info for job ' + str(id) + ' already present in '+fname+'\nRemove it for update')
63                      continue
64                  ## retrieving & processing logging info
65                  if self.retrieveFile( sbi, id, fname):
# Line 68 | Line 68 | class PostMortemServer(PostMortem):
68                      out = "".join(fl.readlines())  
69                      fl.close()
70                      reason = self.decodeLogging(out)
71 <                    common.logger.message('Logging info for job '+ str(id) +': '+str(reason)+'\n      written to '+str(fname)+' \n' )
71 >                    common.logger.info('Logging info for job '+ str(id) +': '+str(reason)+'\n      written to '+str(fname)+' \n' )
72                  else:
73 <                    common.logger.message('Logging info for job '+ str(id) +' not retrieved')
73 >                    common.logger.info('Logging info for job '+ str(id) +' not retrieved')
74              else:
75 <                common.logger.message('Warning: job # ' + str(id) + ' not killed or aborted! Not possible to ask for postMortem ')
75 >                common.logger.info('Warning: job # ' + str(id) + ' not killed or aborted! Will get loggingInfo manually ')
76 >                PostMortem.collectLogging(self)
77          return
78  
79  
# Line 95 | Line 96 | class PostMortemServer(PostMortem):
96          retrieves logging.info file from the server storage area
97          """
98          self.taskuuid = str(common._db.queryTask('name'))
99 <        common.logger.debug(3, "Task name: " + self.taskuuid)
99 >        common.logger.debug( "Task name: " + self.taskuuid)
100  
101          # full remote dir
102          remotedir = os.path.join(self.storage_path, self.taskuuid)
103          remotelog = remotedir + '/loggingInfo_'+str(jobid)+'.log'
104  
105 <        common.logger.message("Starting retrieving logging-info from server " \
105 >        common.logger.info("Starting retrieving logging-info from server " \
106                                 + str(self.storage_name) + " for job " \
107                                 + str(jobid) + "...")
108  
109          # retrieve logging info from storage
110 <        common.logger.debug(1, "retrieving "+ str(remotelog) +" to "+ str(destlog) )
110 >        common.logger.debug( "retrieving "+ str(remotelog) +" to "+ str(destlog) )
111          try:
112              sbi.copy( remotelog, destlog)
113          except Exception, ex:
114              msg = "WARNING: Unable to retrieve logging-info file %s \n"%remotelog
115              msg += str(ex)
116 <            common.logger.debug(1,msg)
116 >            common.logger.debug(msg)
117              return False
118          # cleaning remote logging info file
119          try:
120 <            common.logger.debug(5, "Cleaning remote file [%s] " + str(remotelog) )
120 >            common.logger.debug( "Cleaning remote file [%s] " + str(remotelog) )
121              sbi.delete(remotelog)
122          except Exception, ex:
123              msg = "WARNING: Unable to clean remote logging-info file %s \n"%remotelog
124              msg += str(ex)
125 <            common.logger.debug(5,msg)
125 >            common.logger.debug(msg)
126          return True

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines