@@ -157,15 +157,15 @@ def submitJob(self, **kwargs):
157157 holdReasonSubcode = HOLD_REASON_SUBCODE ,
158158 daysToKeepRemoteLogs = 1 ,
159159 scheddOptions = "" ,
160- extraString = "" ,
160+ extraString = submitOptions ,
161161 pilotStampList = "," .join (stamps ),
162162 )
163163 )
164164
165165 jdlFile .flush ()
166166
167167 cmd = "%s; " % preamble if preamble else ""
168- cmd += "condor_submit %s %s " % ( submitOptions , jdlFile .name )
168+ cmd += "condor_submit %s -spool " % jdlFile .name
169169 sp = subprocess .Popen (
170170 cmd ,
171171 shell = True ,
@@ -379,3 +379,43 @@ def getCEStatus(self, **kwargs):
379379 resultDict ["Waiting" ] += 1
380380
381381 return resultDict
382+
383+ def getJobOutputFiles (self , ** kwargs ):
384+ """Get output file names and templates for the specific CE"""
385+ resultDict = {}
386+
387+ MANDATORY_PARAMETERS = ["JobIDList" , "OutputDir" , "ErrorDir" ]
388+ for argument in MANDATORY_PARAMETERS :
389+ if argument not in kwargs :
390+ resultDict ["Status" ] = - 1
391+ resultDict ["Message" ] = "No %s" % argument
392+ return resultDict
393+
394+ outputDir = kwargs ["OutputDir" ]
395+ errorDir = kwargs ["ErrorDir" ]
396+ jobIDList = kwargs ["JobIDList" ]
397+
398+ cmd = "condor_transfer_data"
399+ sp = subprocess .Popen (
400+ shlex .split (cmd ),
401+ stdout = subprocess .PIPE ,
402+ stderr = subprocess .PIPE ,
403+ universal_newlines = True ,
404+ )
405+ _ , error = sp .communicate ()
406+ status = sp .returncode
407+
408+ if status != 0 :
409+ resultDict ["Status" ] = - 1
410+ resultDict ["Message" ] = error
411+ return resultDict
412+
413+ jobDict = {}
414+ for jobID in jobIDList :
415+ jobDict [jobID ] = {}
416+ jobDict [jobID ]["Output" ] = "%s/%s.out" % (outputDir , jobID )
417+ jobDict [jobID ]["Error" ] = "%s/%s.err" % (errorDir , jobID )
418+
419+ resultDict ["Status" ] = 0
420+ resultDict ["Jobs" ] = jobDict
421+ return resultDict
0 commit comments