87 |
|
except KeyError: self.copy_data = 0 |
88 |
|
|
89 |
|
if ( int(self.return_data) == 0 and int(self.copy_data) == 0 ): |
90 |
< |
msg = 'Error: return_data = 0 and copy_data = 0 ==> your exe output will be lost\n' |
90 |
> |
msg = 'Warning: return_data = 0 and copy_data = 0 ==> your exe output will be lost\n' |
91 |
|
msg = msg + 'Please modify return_data and copy_data value in your crab.cfg file\n' |
92 |
|
raise CrabException(msg) |
93 |
|
|
94 |
– |
if ( int(self.return_data) == 1 and int(self.copy_data) == 1 ): |
95 |
– |
msg = 'Error: return_data and copy_data cannot be set both to 1\n' |
96 |
– |
msg = msg + 'Please modify return_data or copy_data value in your crab.cfg file\n' |
97 |
– |
raise CrabException(msg) |
98 |
– |
|
94 |
|
########### FEDE FOR DBS2 ############################## |
95 |
|
try: |
96 |
|
self.publish_data = cfg_params["USER.publish_data"] |
582 |
|
replicas = self.blackWhiteListParser.checkWhiteList(replicas,n) |
583 |
|
|
584 |
|
if len(replicas)==0: |
585 |
< |
itr = itr + 'target.GlueSEUniqueID=="NONE" ' |
586 |
< |
#msg = 'No sites remaining that host any part of the requested data! Exiting... ' |
592 |
< |
#raise CrabException(msg) |
585 |
> |
msg = 'No sites remaining that host any part of the requested data! Exiting... ' |
586 |
> |
raise CrabException(msg) |
587 |
|
##### |
588 |
|
# for site in sites: |
589 |
|
for site in replicas: |
862 |
|
common.logger.message('No credential delegated to myproxy server '+self.proxyServer+' will do now') |
863 |
|
renewProxy = 1 |
864 |
|
else: |
865 |
< |
## minimum time: 5 days |
866 |
< |
minTime = 4 * 24 * 3600 |
867 |
< |
## regex to extract the right information |
868 |
< |
myproxyRE = re.compile("timeleft: (?P<hours>[\\d]*):(?P<minutes>[\\d]*):(?P<seconds>[\\d]*)") |
869 |
< |
for row in cmd_out.split("\n"): |
870 |
< |
g = myproxyRE.search(row) |
871 |
< |
if g: |
872 |
< |
hours = g.group("hours") |
879 |
< |
minutes = g.group("minutes") |
880 |
< |
seconds = g.group("seconds") |
881 |
< |
timeleft = int(hours)*3600 + int(minutes)*60 + int(seconds) |
882 |
< |
if timeleft < minTime: |
883 |
< |
renewProxy = 1 |
884 |
< |
common.logger.message('Your proxy will expire in:\n\t'+hours+' hours '+minutes+' minutes '+seconds+' seconds\n') |
885 |
< |
common.logger.message('Need to renew it:') |
886 |
< |
pass |
865 |
> |
# if myproxy exist but not long enough, renew |
866 |
> |
reTime = re.compile( r'timeleft: (\d+)' ) |
867 |
> |
#print "<"+str(reTime.search( cmd_out ).group(1))+">" |
868 |
> |
if reTime.match( cmd_out ): |
869 |
> |
time = reTime.search( cmd_out ).group(1) |
870 |
> |
if time < minTimeLeftServer: |
871 |
> |
renewProxy = 1 |
872 |
> |
common.logger.message('No credential delegation will expire in '+time+' hours: renew it') |
873 |
|
pass |
874 |
|
pass |
875 |
|
|