Example #1
0
    def parseSEAccess(self, key, value):
        if key <> 'SE_MOUNT_INFO_LIST':
            return False

        if value.lower() == 'none':
            return True

        for mItem in value.strip('\'"').split():
            parsed = self.mRegex.match(mItem)
            if parsed:
                seItem = parsed.group(1)
                if not seItem in self.seAccess:
                    self.seAccess[seItem] = CommonUtils.SEData(seItem)
                    self.seAccess[seItem].rank = self.seRank
                    self.seRank += 1
                self.seAccess[seItem].export = parsed.group(2)
                self.seAccess[seItem].mount = parsed.group(3)

        return True
Example #2
0
    def run(self):

        line = self.stream.readline()

        while line:
            try:

                parsed = CommonUtils.pRegex.match(line)
                if not parsed:
                    continue

                key = parsed.group(1)
                value = parsed.group(2).strip()

                if key.startswith('PARAM_CE_'):
                    self.ceParamTable[key[9:]] = value
                    continue

                if key.startswith('PARAM_QUEUE_'):
                    self.qParamTable[key[12:]] = value
                    continue

                if key.startswith('PARAM_VO_'):
                    self.voParamTable[key[9:]] = value
                    continue

                if key.startswith('PARAM_SC_'):
                    self.scParamTable[key[9:]] = value
                    continue

                if key == 'CE_HOST':
                    self.ceHost = value
                    continue

                if key == 'COMPUTING_SERVICE_ID':
                    self.compServiceID = value
                    continue

                if key == 'SITE_NAME':
                    self.siteName = value
                    continue

                if key == 'JOB_MANAGER':
                    self.jobmanager = value
                    continue

                if key == 'CE_BATCH_SYS':
                    self.batchsys = value
                    continue

                if key == 'BATCH_VERSION':
                    self.batchsysVer = value
                    continue

                if self.parseCEHostSection(key, value):
                    continue

                if key == 'CE_DATADIR':
                    self.ceDataDir = value
                    continue

                if key == 'CE_CAPABILITY':
                    self.capabilities += value.strip('\'"').split()
                    continue

                if self.parseOldSubClusterVars(key, value):
                    continue

                if self.parseVOSection(key, value):
                    continue

                if key == 'CLUSTERS' and len(value.split()) > 1:
                    self.errList.append("Multiple clusters not supported")
                    continue

                if self.parseClusterSection(key, value):
                    continue

                if self.parseSubClusterSection(key, value):
                    continue

                if key == 'SE_LIST':
                    for seItem in value.strip('\'"').split():
                        self.seAccess[seItem] = CommonUtils.SEData(seItem)
                        self.seAccess[seItem].rank = self.seRank
                        self.seRank += 1
                    continue

                if self.parseSEAccess(key, value):
                    continue

                if self.parseWorkingArea(key, value):
                    continue

                if key == 'USE_ARGUS':
                    self.argusEnabled = value.lower() == 'yes'

                if key == 'CREAM_CLUSTER_MODE' and value.lower() == 'no':
                    self.clusterHost = None

            finally:
                line = self.stream.readline()

        #post processing
        if not self.clusterId:
            self.clusterId = self.ceHost
        if not self.clusterName:
            self.clusterName = self.ceHost
        if not self.clusterSite:
            self.clusterSite = self.siteName

        if len(self.resourceTable) > 1:
            #remove anonymous resource
            del (self.resourceTable['--'])
        else:
            self.resourceTable['--'].id = self.ceHost
            self.resourceTable['--'].name = self.ceHost
            self.resourceTable['--'].tmpDir = '/tmp'
            self.resourceTable['--'].WNDir = '/tmp'

        #
        # TODO merge resource tags from files (replace lcg-info-dynamic-software)
        #

        if not self.compServiceID:
            self.compServiceID = self.ceHost + '_ComputingElement'

        if not self.batchsys:
            self.batchsys = self.jobmanager