Пример #1
0
def parseJobFiles(jobTreeJobsRoot, updatedJobFiles, childJobFileToParentJob,
                  childCounts, config):
    jobFile = getJobFileName(jobTreeJobsRoot)
    if processAnyUpdatingFile(jobFile) or processAnyNewFile(
            jobFile) or os.path.exists(jobFile):
        return _parseJobFiles(jobTreeJobsRoot, updatedJobFiles,
                              childJobFileToParentJob, childCounts, config)
    return reduce(lambda x, y: x + y, [
        parseJobFiles(childDir, updatedJobFiles, childJobFileToParentJob,
                      childCounts, config)
        for childDir in listChildDirs(jobTreeJobsRoot)
    ], [])
Пример #2
0
def _parseJobFiles(jobTreeJobsRoot, updatedJobFiles, childJobFileToParentJob, childCounts, config):
    #Read job
    job = Job.read(getJobFileName(jobTreeJobsRoot))
    #Reset the job
    job.messages = []
    job.children = []
    job.remainingRetryCount = int(config.attrib["try_count"])
    #Get children
    childJobs = reduce(lambda x,y:x+y, [ parseJobFiles(childDir, updatedJobFiles, childJobFileToParentJob, childCounts, config) for childDir in listChildDirs(jobTreeJobsRoot) ], [])
    if len(childJobs) > 0:
        childCounts[job] = len(childJobs)
        for childJob in childJobs:
            childJobFileToParentJob[childJob.getJobFileName()] = job 
    elif len(job.followOnCommands) > 0:
        updatedJobFiles.add(job)
    else: #Job is stub with nothing left to do, so ignore
        return []
    return [ job ]
Пример #3
0
def _parseJobFiles(jobTreeJobsRoot, updatedJobFiles, childJobFileToParentJob,
                   childCounts, config):
    #Read job
    job = Job.read(getJobFileName(jobTreeJobsRoot))
    #Reset the job
    job.messages = []
    job.children = []
    job.remainingRetryCount = int(config.attrib["try_count"])
    #Get children
    childJobs = reduce(lambda x, y: x + y, [
        parseJobFiles(childDir, updatedJobFiles, childJobFileToParentJob,
                      childCounts, config)
        for childDir in listChildDirs(jobTreeJobsRoot)
    ], [])
    if len(childJobs) > 0:
        childCounts[job] = len(childJobs)
        for childJob in childJobs:
            childJobFileToParentJob[childJob.getJobFileName()] = job
    elif len(job.followOnCommands) > 0:
        updatedJobFiles.add(job)
    else:  #Job is stub with nothing left to do, so ignore
        return []
    return [job]
Пример #4
0
def parseJobFiles(jobTreeJobsRoot, updatedJobFiles, childJobFileToParentJob, childCounts, config):
    jobFile = getJobFileName(jobTreeJobsRoot)
    if processAnyUpdatingFile(jobFile) or processAnyNewFile(jobFile) or os.path.exists(jobFile):
        return _parseJobFiles(jobTreeJobsRoot, updatedJobFiles, childJobFileToParentJob, childCounts, config)
    return reduce(lambda x,y:x+y, [ parseJobFiles(childDir, updatedJobFiles, childJobFileToParentJob, childCounts, config) for childDir in listChildDirs(jobTreeJobsRoot) ], [])