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

Comparing COMP/CRAB/python/SchedulerEdg.py (file contents):
Revision 1.49 by spiga, Fri Apr 7 12:58:38 2006 UTC vs.
Revision 1.50 by slacapra, Thu Apr 13 15:59:08 2006 UTC

# Line 2 | Line 2 | from Scheduler import Scheduler
2   from crab_logger import Logger
3   from crab_exceptions import *
4   from crab_util import *
5 + from EdgConfig import *
6   import common
7  
8   import os, sys, time
# Line 764 | Line 765 | class SchedulerEdg(Scheduler):
765          """
766          if (self.proxyValid): return
767          timeleft = -999
768 <        minTimeLeft=10 # in hours
769 <        cmd = 'voms-proxy-info -exists -valid '+str(minTimeLeft)+':00'
770 <        # SL Here I have to use os.system since the stupid command exit with >0 if no valid proxy is found
771 <        cmd_out = os.system(cmd)
772 <        if (cmd_out>0):
768 >        minTimeLeft=10*3600 # in seconds
769 >        #cmd = 'voms-proxy-info -exists -valid '+str(minTimeLeft)+':00'
770 >        #cmd = 'voms-proxy-info -timeleft'
771 >        mustRenew = 0
772 >        timeLeftLocal = runCommand('voms-proxy-info -timeleft')
773 >        timeLeftServer = -999
774 >        if not timeLeftLocal or not isInt(timeLeftLocal):
775 >            mustRenew = 1
776 >        else:
777 >            timeLeftServer = runCommand('voms-proxy-info -actimeleft')
778 >            if not timeLeftServer or not isInt(timeLeftServer):
779 >                mustRenew = 1
780 >            elif timeLeftServer<minTimeLeft or timeLeftServer<minTimeLeft:
781 >                mustRenew = 1
782 >            pass
783 >        pass
784 >
785 >        if (mustRenew):
786              common.logger.message( "No valid proxy found or timeleft too short!\n Creating a user proxy with default length of 24h\n")
787              cmd = 'voms-proxy-init -voms cms -valid 100:00'
788              try:
# Line 778 | Line 792 | class SchedulerEdg(Scheduler):
792              except:
793                  msg = "Unable to create a valid proxy!\n"
794                  raise CrabException(msg)
781            # cmd = 'grid-proxy-info -timeleft'
782            # cmd_out = runCommand(cmd,0,20)
795              pass
796          self.proxyValid=1
797          return

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines