def isValid(self, validity="", log=False, force_check=False): # Do parent check if not ICredential.isValid(self, validity, log, force_check): return False # check vo names if self.voname() != self.voms: if log: logger.warning("Grid Proxy not valid. Certificate VO '%s' does not match requested '%s'" % (self.voname(), self.voms)) return False return True
def __init__(self): self.active = True self.credential = ICredential() # FIXME: or the real one #import Ganga.Core.FileWorkspace #basedir = Ganga.Core.FileWorkspace.gettop() #basedir = '/tmp' basedir = '.' self.gridmap_filename = '%s/lcg_simulator_gridmap' % basedir import shelve # map Grid job id into inputdir (where JDL file is) self.jobid_map = shelve.open(self.gridmap_filename, writeback=False) self.jobid_map.setdefault('_job_count', 0) # here we store the job finish times as seen by ganga self.finished_jobs_filename = '%s/lcg_simulator_finished_jobs' % basedir self.ganga_finish_time = shelve.open(self.finished_jobs_filename, writeback=False) self.shell = getShell('GLITE') logger.critical('Grid Simulator data files: %s %s', self.gridmap_filename, self.finished_jobs_filename)
def destroy(self, allowed_exit=[0, 1]): self.chooseCommandSet() self.buildOpts(self.command.destroy) return ICredential.destroy(self, allowed_exit)
def create(self, validity="", maxTry=0, minValidity="", check=False): self.chooseCommandSet() self.buildOpts(self.command.init) status = ICredential.create(self, validity, maxTry, minValidity, check) return status
def timeleft(self, units="hh:mm:ss", force_check=False): return ICredential.timeleft(self, units, force_check=force_check)
def renew(self, validity="", maxTry=0, minValidity="", check=True): return ICredential.renew(self, validity, maxTry, minValidity, check)
def isValid(self, validity="", log=False, force_check=False): return ICredential.isValid(self, validity, log, force_check)
def destroy(self, allowed_exit=[0]): self.buildOpts(self.command.destroy) return ICredential.destroy(self, allowed_exit)
def timeleft(self, units="hh:mm:ss", force_check=False): return ICredential.timeleft(self, units, force_check)
def renew(self, validity="", maxTry=0, minValidity="", check=True): self.chooseCommandSet() if self.voms: if not self.voname(): check = False return ICredential.renew(self, validity, maxTry, minValidity, check)
def create(self, validity="", maxTry=0, minValidity="", check=False): self.buildOpts(self.command.init) return ICredential.create(self, validity, maxTry, minValidity, check)