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-29 12:05:31 +0100 |
commit | 117a6dac73b7642f56e9e51a890748679d6dbab4 (patch) | |
tree | eda772c689dad91a97ed093d510b1d215fe9d968 | |
parent | 1bf1e1539fb72f0bc594b4b2367482dd13c8c633 (diff) | |
download | poky-117a6dac73b7642f56e9e51a890748679d6dbab4.tar.gz |
cve-update-db-native: prevent fatal error cause by network
prevent cve-check from fatal error cause by network issue.
[YOCTO #13680]
(From OE-Core rev: da358e415726f836e6b3e69ad7fbeffb50bd402d)
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.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() { | |||
59 | json_url = year_url + ".json.gz" | 59 | json_url = year_url + ".json.gz" |
60 | 60 | ||
61 | # Retrieve meta last modified date | 61 | # Retrieve meta last modified date |
62 | response = urllib.request.urlopen(meta_url) | 62 | try: |
63 | response = urllib.request.urlopen(meta_url) | ||
64 | except urllib.error.URLError as e: | ||
65 | cve_f.write('Warning: CVE db update error, Unable to fetch CVE data.\n\n') | ||
66 | bb.warn("Failed to fetch CVE data (%s)" % e.reason) | ||
67 | return | ||
68 | |||
63 | if response: | 69 | if response: |
64 | for l in response.read().decode("utf-8").splitlines(): | 70 | for l in response.read().decode("utf-8").splitlines(): |
65 | key, value = l.split(":", 1) | 71 | key, value = l.split(":", 1) |