Esempio n. 1
0
def NeedsToBeAnalyzed(FinalModuleResultsPath,ModuleInformation):
    if args.force == True:
        return True
    md5FileName= FinalModuleResultsPath+'/'+ 'checksum.md5'
    retVal = True

    if len(args.modules_list) > 0:
        ModulesList = [x.strip().upper() for x in args.modules_list.replace(';',',').split(',')]
        if ModuleInformation['ModuleID'].upper() in ModulesList:
            print 'analyse folder '+ FinalModuleResultsPath +'\n'
            return True
        else:
            print 'do not analyse folder '+ FinalModuleResultsPath +'\n'
            return False

    if os.path.exists(md5FileName):
        if verbose: print 'md5 sum exists %s'%md5FileName
        bSameFiles = hasher.compare_two_files('checksum.md5',md5FileName)
        if not Configuration.getboolean('SystemConfiguration','UseGlobalDatabase'):
            if args.no_re_analysis:
                # if -new parameter is specified, check if there if a file with same date or even a newer file in db
                bExistInDB = TestResultEnvironmentInstance.existInDB(ModuleInformation['ModuleID'],ModuleInformation['QualificationType'],ModuleInformation['TestDate'])
            else:
                bExistInDB = TestResultEnvironmentInstance.existInDB(ModuleInformation['ModuleID'],ModuleInformation['QualificationType'])
            if verbose: print 'check if Module exists: %s'%bExistInDB
        else:
            if verbose: print 'use Global DataBase: ',Configuration.get('SystemConfiguration','UseGlobalDatabase')
            bExistInDB = False
        if verbose: print 'same file: %s / exists in DB: %s'%(bSameFiles,bExistInDB)
        if (bSameFiles or args.no_re_analysis) and bExistInDB:
            print 'do not analyse folder '+ FinalModuleResultsPath +'\n'
            retVal = False
    return retVal
Esempio n. 2
0
def NeedsToBeAnalyzed(FinalModuleResultsPath, ModuleInformation):
    if args.force == True:
        return True
    md5FileName = FinalModuleResultsPath + '/' + 'checksum.md5'
    retVal = True
    if os.path.exists(md5FileName):
        if verbose: print 'md5 sum exists %s' % md5FileName
        bSameFiles = hasher.compare_two_files('checksum.md5', md5FileName)
        if not Configuration.getboolean('SystemConfiguration',
                                        'UseGlobalDatabase'):
            if args.no_re_analysis:
                # if -new parameter is specified, check if there if a file with same date or even a newer file in db
                bExistInDB = TestResultEnvironmentInstance.existInDB(
                    ModuleInformation['ModuleID'],
                    ModuleInformation['QualificationType'],
                    ModuleInformation['TestDate'])
            else:
                bExistInDB = TestResultEnvironmentInstance.existInDB(
                    ModuleInformation['ModuleID'],
                    ModuleInformation['QualificationType'])
            if verbose: print 'check if Module exists: %s' % bExistInDB
        else:
            if verbose:
                print 'use Global DataBase: ', Configuration.get(
                    'SystemConfiguration', 'UseGlobalDatabase')
            bExistInDB = False
        if verbose:
            print 'same file: %s / exists in DB: %s' % (bSameFiles, bExistInDB)
        if (bSameFiles or args.no_re_analysis) and bExistInDB:
            print 'do not analyse folder ' + FinalModuleResultsPath + '\n'
            retVal = False
    return retVal
Esempio n. 3
0
def NeedsToBeAnalyzed(FinalModuleResultsPath,ModuleInformation):
    if args.force == True:
        return True
    md5FileName= FinalModuleResultsPath+'/'+ 'checksum.md5'
    retVal = True
    if os.path.exists(md5FileName):
        if verbose: print 'md5 sum exists %s'%md5FileName
        bSameFiles = hasher.compare_two_files('checksum.md5',md5FileName)
        if not Configuration.getboolean('SystemConfiguration','UseGlobalDatabase'):
            bExistInDB = TestResultEnvironmentInstance.existInDB(ModuleInformation['ModuleID'],ModuleInformation['QualificationType'])
            if verbose: print 'check if Module exists: %s'%bExistInDB
        else:
            if verbose: print 'use Global DataBase: ',Configuration.get('SystemConfiguration','UseGlobalDatabase')
            bExistInDB = False
        if verbose: print 'same file: %s / exists in DB: %s'%(bSameFiles,bExistInDB)
        if bSameFiles and bExistInDB:
            print 'do not analyse folder '+ FinalModuleResultsPath +'\n'
            retVal = False
    return retVal