cve-update-db-native: prevent fatal error cause by network
PATCH 1/1 cve-update-db-native: prevent fatal error cause by network
From: Lee Chee Yang <[email protected]>
prevent cve-check from fatal error cause by network issue.
[YOCTO #13680]
Signed-off-by Lee Chee Yang <[email protected]>
--- meta/recipes-core/meta/cve-update-db-native.bb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
meta/recipes-core/meta/cve-update-db-native.bb +7 -1
@@ -59,7 +59,13 @@ python do_populate_cve_db() { json_url = year_url + ".json.gz" # Retrieve meta last modified date - response = urllib.request.urlopen(meta_url) + try: + response = urllib.request.urlopen(meta_url) + except urllib.error.URLError as e: + cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n') + bb.warn("Failed to fetch CVE data (%s)" % e.reason) + return + if response: for l in response.read().decode("utf-8").splitlines(): key, value = l.split(":", 1)
Signature · 1 line
2.7.4