def ce_list(self): ceParser = CEBlackWhiteListParser(self.EDG_ce_white_list, self.EDG_ce_black_list, common.logger()) wl = ','.join(ceParser.whiteList()) or None bl = ','.join(ceParser.blackList()) or None return '', wl, bl
def ce_list(self): """ Returns string with requirement CE related """ ceParser = CEBlackWhiteListParser(self.EDG_ce_white_list, self.EDG_ce_black_list, common.logger()) req = '' ce_white_list = [] ce_black_list = [] if self.EDG_ce_white_list: ce_white_list = ceParser.whiteList() tmpCe = [] concString = '&&' for ce in ce_white_list: tmpCe.append('RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId)') if len(tmpCe) == 1: req += " && (" + concString.join(tmpCe) + ") " elif len(tmpCe) > 1: firstCE = 0 for reqTemp in tmpCe: if firstCE == 0: req += " && ( (" + reqTemp + ") " firstCE = 1 elif firstCE > 0: req += " || (" + reqTemp + ") " if firstCE > 0: req += ") " if self.EDG_ce_black_list: ce_black_list = ceParser.blackList() tmpCe = [] concString = '&&' for ce in ce_black_list: tmpCe.append('(!RegExp("' + string.strip(ce) + '", other.GlueCEUniqueId))') if len(tmpCe): req += " && (" + concString.join(tmpCe) + ") " # requirement added to skip gliteCE # not more needed # req += '&& (!RegExp("blah", other.GlueCEUniqueId))' retWL = ','.join(ce_white_list) retBL = ','.join(ce_black_list) if not retWL: retWL = None if not retBL: retBL = None return req, retWL, retBL
def configure(self, cfgParams): """ Configure the scheduler with the config settings from the user """ # FIXME: Get rid of try/except and use get() instead if not os.environ.has_key('EDG_WL_LOCATION'): # This is an ugly hack needed for SchedulerGrid.configure() to # work! os.environ['EDG_WL_LOCATION'] = '' if not os.environ.has_key('X509_USER_PROXY'): # Set X509_USER_PROXY to the default location. We'll do this # because in functions called by Scheduler.checkProxy() # voms-proxy-info will be called with '-file $X509_USER_PROXY', # so if X509_USER_PROXY isn't set, it won't work. os.environ['X509_USER_PROXY'] = '/tmp/x509up_u' + str(os.getuid()) SchedulerGrid.configure(self, cfgParams) if cfgParams.get('CRAB.server_name',None) or cfgParams.get('CRAB.use_server',None): pass else: self.checkCondorSetup() # init BlackWhiteListParser ceWhiteList = cfgParams.get('GRID.ce_white_list',[]) ceBlackList = cfgParams.get('GRID.ce_black_list',[]) self.ceBlackWhiteListParser = \ CEBlackWhiteListParser(ceWhiteList, ceBlackList, common.logger()) try: self.GLOBUS_RSL = cfgParams['CONDORG.globus_rsl'] except KeyError: self.GLOBUS_RSL = '' # Provide an override for the batchsystem that condor_g specifies # as a grid resource. This is to handle the case where the site # supports several batchsystem but bdii only allows a site # to public one. try: self.batchsystem = cfgParams['CONDORG.batchsystem'] msg = self.msgPre + 'batchsystem overide specified in your crab.cfg' common.logger.debug(msg) except KeyError: self.batchsystem = '' self.datasetPath = '' try: tmp = cfgParams['CMSSW.datasetpath'] if tmp.lower() == 'none': self.datasetPath = None self.selectNoInput = 1 else: self.datasetPath = tmp self.selectNoInput = 0 except KeyError: msg = "Error: datasetpath not defined " raise CrabException(msg) return