示例#1
0
def collectData():
    printDBG(1, "Collecting data from Satellite")
    s = Satellite(credentials['hostname'])
    s.setUsername(credentials['username'])
    s.setPassword(credentials['password'])
    printDBG(2, "Getting initial (baseline) content view version errata")
    cvve1 = s.getCVVerErrata(args.initial)
    baselineErrata = cvve1['total']
    printDBG(2, "Getting target content view version errata")
    cvve2 = s.getCVVerErrata(args.final)
    targetErrata = cvve2['total']
    list1 = []
    for cve in cvve1['results']:
        list1.append(cve['id'])
    for cve in cvve2['results']:
        if cve['id'] not in list1:
            finalList.append(cve)
    if not len(finalList) == targetErrata - baselineErrata:
        printDBG(
            1, "Errata mis-count - length not equal to difference in sizes!")
    printDBG(2, "Data gathered, differential list processed")
示例#2
0
def collectData():
    printDBG(1, "Collecting data from Satellite")
    s = Satellite(credentials['hostname'])
    s.setUsername(credentials['username'])
    s.setPassword(credentials['password'])
    printDBG(2, "Getting all content view versions")

    cvvs = s.getCVVersions()
    for ver in cvvs['results']:
        name = ver['name']
        cVVObjects[name] = {}
        object = cVVObjects[name]
        object['id'] = ver['id']
        object['cvID'] = ver['content_view_id']
        object['secErrata'] = ver['errata_counts']['security']
        object['bugErrata'] = ver['errata_counts']['bugfix']
        object['enhErrata'] = ver['errata_counts']['enhancement']
        if type(object['secErrata']) == type(None):
            object['secErrata'] = 0
        if type(object['bugErrata']) == type(None):
            object['bugErrata'] = 0
        if type(object['enhErrata']) == type(None):
            object['enhErrata'] = 0
        object['created'] = ver['created_at']
        object['errata'] = {}
        printDBG(3, 'Getting errata for CV Ver ' + name)
        errata = s.getCVVerErrata(object['id'])
        for erratum in errata['results']:
            eo = {}
            eo['id'] = erratum['id']
            eo['name'] = erratum['name']
            eo['type'] = erratum['type']
            eo['issued'] = erratum['issued']
            eo['cves'] = []
            for cve in erratum['cves']:
                eo['cves'].append(cve['cve_id'])
            object['errata'][erratum['errata_id']] = eo

    for revName in cVVObjects.keys().sort(reverse=True):
        print revName