support/scripts: fix flake8 errors in cve-checker and pkg-stats
Note that one is silenced, rather than fixed: we indeed need to import after we add the local directory to the modules search path. Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com> Cc: Arnout Vandecappelle <arnout@mind.be> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
committed by
Thomas Petazzoni
parent
986db051ba
commit
843334bf4f
@@ -25,15 +25,12 @@ import os
|
||||
from collections import defaultdict
|
||||
import re
|
||||
import subprocess
|
||||
import requests # NVD database download
|
||||
import json
|
||||
import time
|
||||
import sys
|
||||
|
||||
sys.path.append('utils/')
|
||||
from getdeveloperlib import parse_developers # noqa: E402
|
||||
|
||||
import cve as cvecheck
|
||||
import cve as cvecheck # noqa: E402
|
||||
|
||||
|
||||
INFRA_RE = re.compile(r"\$\(eval \$\(([a-z-]*)-package\)\)")
|
||||
@@ -538,9 +535,10 @@ def check_package_cves(nvd_path, packages):
|
||||
for pkg_name in cve.pkg_names:
|
||||
if pkg_name in packages:
|
||||
pkg = packages[pkg_name]
|
||||
if cve.affects(pkg.name, pkg.current_version, pkg.ignored_cves) == cve.CVE_AFFECTS :
|
||||
if cve.affects(pkg.name, pkg.current_version, pkg.ignored_cves) == cve.CVE_AFFECTS:
|
||||
pkg.cves.append(cve.identifier)
|
||||
|
||||
|
||||
def calculate_stats(packages):
|
||||
stats = defaultdict(int)
|
||||
stats['packages'] = len(packages)
|
||||
|
||||
Reference in New Issue
Block a user