summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLee Chee Yang <chee.yang.lee@intel.com>2020-03-25 19:29:54 +0800
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-03-25 16:09:29 +0000
commitda358e415726f836e6b3e69ad7fbeffb50bd402d (patch)
treeced0a237ebd8aa373401ed5e40bdefe53cca93d3
parentdb80305e10d501900e1e371a6f9a4da5cf0b033e (diff)
downloadopenembedded-core-contrib-da358e415726f836e6b3e69ad7fbeffb50bd402d.tar.gz
openembedded-core-contrib-da358e415726f836e6b3e69ad7fbeffb50bd402d.tar.bz2
openembedded-core-contrib-da358e415726f836e6b3e69ad7fbeffb50bd402d.zip
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 <chee.yang.lee@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-core/meta/cve-update-db-native.bb8
1 files changed, 7 insertions, 1 deletions
diff --git a/meta/recipes-core/meta/cve-update-db-native.bb b/meta/recipes-core/meta/cve-update-db-native.bb
index 575254af40..95a0dfcc90 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)