From: Lee Chee Yang Date: Wed, 25 Mar 2020 11:29:54 +0000 (+0800) Subject: cve-update-db-native: prevent fatal error cause by network X-Git-Tag: lucaceresoli/bug-15201-perf-libtraceevent-missing~11467 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da358e415726f836e6b3e69ad7fbeffb50bd402d;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git cve-update-db-native: prevent fatal error cause by network prevent cve-check from fatal error cause by network issue. [YOCTO #13680] Signed-off-by: Lee Chee Yang Signed-off-by: Richard Purdie --- diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb index 575254af40c..95a0dfcc909 100644 --- a/meta/recipes-core/meta/cve-update-db-native.bb +++ b/meta/recipes-core/meta/cve-update-db-native.bb @@ -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)