failed_filename = 'failed_runs_' + nameend rmfailed = commands.getstatusoutput('rm -rf ' + failed_filename) failed_out = open(failed_filename,'w') #Write file with OK runs OK_filename = 'ok_runs_' + nameend rmok = commands.getstatusoutput('rm -rf ' + OK_filename) OK_out = open(OK_filename,'w') #Look at the job output we already have #----------------------------------------------------------- print 'Loop over job outputs...' command= 'ls -d ' + outdir + '/' + username + '_*' lines,errors = runLCG(command,is_pexpect=False) midnames = [] jidnames = [] jcounter = 0 for l in lines: l = l.replace('\n','') command = 'ls ' + l + '/'+job+'_*.cfg' lines,errors = runLCG(command,is_pexpect=False) ll = lines if len(ll) == 0: continue lll=ll[0].replace('\n','') llar=lll.split('/') cfgname=llar[-1]
LFCDir = ND280Dir(lfc_dir_name, ls_timeout=3600) # Keep list of files that are not at RAL - don't delete! missingFromRAL = [] for LFCFile in LFCDir.ND280Files: replicas = LFCFile.reps ## First ensure file is at RAL isAtRAL = False for rep in replicas: if 'srm-t2k.gridpp' in rep: ## make sure it isn't a null size replica: command = 'lcg-ls -l ' + rep lines, errors = runLCG(command) if lines and not errors: surl_size = int(lines[0].split()[-3]) if surl_size == 0: command = 'lcg-del ' + rep lines, errors = runLCG(command) else: isAtRAL = True if not isAtRAL: missingFromRAL.append(LFCFile.alias) else: for rep in replicas: if srm_opt in rep: