[gnome-build-meta] utils/update-local-cve-database.py: don't error out if the database isn't available for a given year



commit 18509b69d3d95ca0e94a60a088cfb2294f4ce9d1
Author: Abderrahim Kitouni <akitouni gnome org>
Date:   Wed Jan 1 11:47:14 2020 +0100

    utils/update-local-cve-database.py: don't error out if the database isn't available for a given year
    
    There is still no database for 2020

 utils/update-local-cve-database.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/utils/update-local-cve-database.py b/utils/update-local-cve-database.py
index 4082ffdc..a0f828c1 100755
--- a/utils/update-local-cve-database.py
+++ b/utils/update-local-cve-database.py
@@ -128,9 +128,13 @@ def update_year(c, year, url_timeout):
             raise
         print("Timeout, using cache for {}".format('nvdcve-1.1-{}.json.gz'.format(year)))
     except urllib.error.HTTPError as error:
-        if error.code != 304:
+        if error.code == 304:
+            print("Cached {}".format('nvdcve-1.1-{}.json.gz'.format(year)))
+        elif error.code == 404:
+            print("{} not found".format('nvdcve-1.1-{}.json.gz'.format(year)))
+            return
+        else:
             raise
-        print("Cached {}".format('nvdcve-1.1-{}.json.gz'.format(year)))
 
     with gzip.open('nvdcve-1.1-{}.json.gz'.format(year)) as f:
         tree = json.load(f)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]