diff options
author | Lee Chee Yang <chee.yang.lee@intel.com> | 2020-03-25 19:29:54 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-03-25 16:09:29 +0000 |
commit | da358e415726f836e6b3e69ad7fbeffb50bd402d (patch) | |
tree | ced0a237ebd8aa373401ed5e40bdefe53cca93d3 /meta/recipes-core/meta | |
parent | db80305e10d501900e1e371a6f9a4da5cf0b033e (diff) | |
download | openembedded-core-contrib-da358e415726f836e6b3e69ad7fbeffb50bd402d.tar.gz |
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>
Diffstat (limited to 'meta/recipes-core/meta')
-rw-r--r-- | meta/recipes-core/meta/cve-update-db-native.bb | 8 |
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) |