56 |
|
concString = '&&' |
57 |
|
for ce in ce_white_list: |
58 |
|
tmpCe.append('RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId)') |
59 |
< |
if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") " |
59 |
> |
### MATTY' FIX: if more then one CE: && -> || |
60 |
> |
#print "list CE: " + str(tmpCe) |
61 |
> |
if len(tmpCe) == 1: |
62 |
> |
req += " && (" + concString.join(tmpCe) + ") " |
63 |
> |
elif len(tmpCe) > 1: |
64 |
> |
firstCE = 0 |
65 |
> |
for reqTemp in tmpCe: |
66 |
> |
#print reqTemp |
67 |
> |
if firstCE == 0: |
68 |
> |
#print "adding: "+str(" && ( (" + reqTemp + ") ") |
69 |
> |
req += " && ( (" + reqTemp + ") " |
70 |
> |
firstCE = 1 |
71 |
> |
elif firstCE > 0: |
72 |
> |
#print "adding: "+str(" || (" + reqTemp + ") ") |
73 |
> |
req += " || (" + reqTemp + ") " |
74 |
> |
if firstCE > 0: |
75 |
> |
req += ") " |
76 |
> |
## old code |
77 |
> |
# if len(tmpCe): req = req + " && (" + concString.join(tmpCe) + ") " |
78 |
|
|
79 |
|
if self.EDG_ce_black_list: |
80 |
|
ce_black_list = string.split(self.EDG_ce_black_list,',') |
152 |
|
txt += ' echo "middleware =$middleware" \n' |
153 |
|
txt += 'elif [ $GRID3_APP_DIR ]; then\n' |
154 |
|
txt += ' middleware=OSG \n' |
155 |
< |
txt += ' echo "SyncCE=`echo $EDG_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n' |
155 |
> |
txt += ' echo "SyncCE=`echo $GLITE_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n' |
156 |
|
txt += ' echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n' |
157 |
|
txt += ' echo "middleware =$middleware" \n' |
158 |
|
txt += 'elif [ $OSG_APP ]; then \n' |
159 |
|
txt += ' middleware=OSG \n' |
160 |
< |
txt += ' echo "SyncCE=`echo $EDG_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n' |
160 |
> |
txt += ' echo "SyncCE=`echo $GLITE_WL_LOG_DESTINATION`" | tee -a $RUNTIME_AREA/$repo \n' |
161 |
|
txt += ' echo "GridFlavour=`echo $middleware`" | tee -a $RUNTIME_AREA/$repo \n' |
162 |
|
txt += ' echo "middleware =$middleware" \n' |
163 |
|
txt += 'else \n' |
179 |
|
|
180 |
|
txt += '\n\n' |
181 |
|
|
182 |
< |
if int(self.copy_data) == 1: |
183 |
< |
if self.SE: |
184 |
< |
txt += 'export SE='+self.SE+'\n' |
185 |
< |
txt += 'echo "SE = $SE"\n' |
186 |
< |
if self.SE_PATH: |
187 |
< |
if ( self.SE_PATH[-1] != '/' ) : self.SE_PATH = self.SE_PATH + '/' |
188 |
< |
txt += 'export SE_PATH='+self.SE_PATH+'\n' |
189 |
< |
txt += 'echo "SE_PATH = $SE_PATH"\n' |
182 |
> |
#if int(self.copy_data) == 1: |
183 |
> |
# if self.SE: |
184 |
> |
# txt += 'export SE='+self.SE+'\n' |
185 |
> |
# txt += 'echo "SE = $SE"\n' |
186 |
> |
# if self.SE_PATH: |
187 |
> |
# if ( self.SE_PATH[-1] != '/' ) : self.SE_PATH = self.SE_PATH + '/' |
188 |
> |
# txt += 'export SE_PATH='+self.SE_PATH+'\n' |
189 |
> |
# txt += 'echo "SE_PATH = $SE_PATH"\n' |
190 |
|
|
191 |
|
txt += 'export VO='+self.VO+'\n' |
192 |
|
### some line for LFC catalog setting |
193 |
< |
txt += 'if [ $middleware == LCG ]; then \n' |
194 |
< |
txt += ' if [[ $LCG_CATALOG_TYPE != \''+self.lcg_catalog_type+'\' ]]; then\n' |
195 |
< |
txt += ' export LCG_CATALOG_TYPE='+self.lcg_catalog_type+'\n' |
196 |
< |
txt += ' fi\n' |
197 |
< |
txt += ' if [[ $LFC_HOST != \''+self.lfc_host+'\' ]]; then\n' |
198 |
< |
txt += ' export LFC_HOST='+self.lfc_host+'\n' |
199 |
< |
txt += ' fi\n' |
200 |
< |
txt += ' if [[ $LFC_HOME != \''+self.lfc_home+'\' ]]; then\n' |
201 |
< |
txt += ' export LFC_HOME='+self.lfc_home+'\n' |
202 |
< |
txt += ' fi\n' |
203 |
< |
txt += 'elif [ $middleware == OSG ]; then\n' |
204 |
< |
txt += ' echo "LFC catalog setting to be implemented for OSG"\n' |
205 |
< |
txt += 'fi\n' |
193 |
> |
#txt += 'if [ $middleware == LCG ]; then \n' |
194 |
> |
#txt += ' if [[ $LCG_CATALOG_TYPE != \''+self.lcg_catalog_type+'\' ]]; then\n' |
195 |
> |
#txt += ' export LCG_CATALOG_TYPE='+self.lcg_catalog_type+'\n' |
196 |
> |
#txt += ' fi\n' |
197 |
> |
#txt += ' if [[ $LFC_HOST != \''+self.lfc_host+'\' ]]; then\n' |
198 |
> |
#txt += ' export LFC_HOST='+self.lfc_host+'\n' |
199 |
> |
#txt += ' fi\n' |
200 |
> |
#txt += ' if [[ $LFC_HOME != \''+self.lfc_home+'\' ]]; then\n' |
201 |
> |
#txt += ' export LFC_HOME='+self.lfc_home+'\n' |
202 |
> |
#txt += ' fi\n' |
203 |
> |
#txt += 'elif [ $middleware == OSG ]; then\n' |
204 |
> |
#txt += ' echo "LFC catalog setting to be implemented for OSG"\n' |
205 |
> |
#txt += 'fi\n' |
206 |
|
##### |
207 |
< |
if int(self.register_data) == 1: |
208 |
< |
txt += 'if [ $middleware == LCG ]; then \n' |
209 |
< |
txt += ' export LFN='+self.LFN+'\n' |
210 |
< |
txt += ' lfc-ls $LFN\n' |
211 |
< |
txt += ' result=$?\n' |
212 |
< |
txt += ' echo $result\n' |
213 |
< |
### creation of LFN dir in LFC catalog, under /grid/cms dir |
214 |
< |
txt += ' if [ $result != 0 ]; then\n' |
215 |
< |
txt += ' lfc-mkdir $LFN\n' |
216 |
< |
txt += ' result=$?\n' |
217 |
< |
txt += ' echo $result\n' |
218 |
< |
txt += ' fi\n' |
219 |
< |
txt += 'elif [ $middleware == OSG ]; then\n' |
220 |
< |
txt += ' echo " Files registration to be implemented for OSG"\n' |
221 |
< |
txt += 'fi\n' |
222 |
< |
txt += '\n' |
223 |
< |
|
224 |
< |
if self.VO: |
225 |
< |
txt += 'export VO='+self.VO+'\n' |
226 |
< |
if self.LFN: |
227 |
< |
txt += 'if [ $middleware == LCG ]; then \n' |
228 |
< |
txt += ' export LFN='+self.LFN+'\n' |
229 |
< |
txt += 'fi\n' |
212 |
< |
txt += '\n' |
207 |
> |
#if int(self.register_data) == 1: |
208 |
> |
# txt += 'if [ $middleware == LCG ]; then \n' |
209 |
> |
# txt += ' export LFN='+self.LFN+'\n' |
210 |
> |
# txt += ' lfc-ls $LFN\n' |
211 |
> |
# txt += ' result=$?\n' |
212 |
> |
# txt += ' echo $result\n' |
213 |
> |
# ### creation of LFN dir in LFC catalog, under /grid/cms dir |
214 |
> |
# txt += ' if [ $result != 0 ]; then\n' |
215 |
> |
# txt += ' lfc-mkdir $LFN\n' |
216 |
> |
# txt += ' result=$?\n' |
217 |
> |
# txt += ' echo $result\n' |
218 |
> |
# txt += ' fi\n' |
219 |
> |
# txt += 'elif [ $middleware == OSG ]; then\n' |
220 |
> |
# txt += ' echo " Files registration to be implemented for OSG"\n' |
221 |
> |
# txt += 'fi\n' |
222 |
> |
# txt += '\n' |
223 |
> |
# if self.VO: |
224 |
> |
# txt += 'export VO='+self.VO+'\n' |
225 |
> |
# if self.LFN: |
226 |
> |
# txt += 'if [ $middleware == LCG ]; then \n' |
227 |
> |
# txt += ' export LFN='+self.LFN+'\n' |
228 |
> |
# txt += 'fi\n' |
229 |
> |
# txt += '\n' |
230 |
|
|
231 |
|
txt += 'if [ $middleware == LCG ]; then\n' |
232 |
|
txt += ' CloseCEs=`glite-brokerinfo getCE`\n' |
266 |
|
return cmd_out |
267 |
|
|
268 |
|
def findSites_(self, n): |
269 |
+ |
itr4 = [] |
270 |
|
sites = common.jobDB.destination(n) |
271 |
|
if len(sites)>0 and sites[0]=="": |
272 |
< |
return [] |
273 |
< |
return sites |
272 |
> |
return itr4 |
273 |
> |
if sites != [""]: |
274 |
> |
##Addedd Daniele |
275 |
> |
replicas = self.blackWhiteListParser.checkBlackList(sites,n) |
276 |
> |
if len(replicas)!=0: |
277 |
> |
replicas = self.blackWhiteListParser.checkWhiteList(replicas,n) |
278 |
> |
|
279 |
> |
if len(replicas)==0: |
280 |
> |
msg = 'No sites remaining that host any part of the requested data! Exiting... ' |
281 |
> |
raise CrabException(msg) |
282 |
> |
itr4 = replicas |
283 |
> |
##### |
284 |
> |
return itr4 |
285 |
> |
|
286 |
> |
def submitTout(self, list): |
287 |
> |
return 180 |