Commit 5b8bb386 authored by Alexandre Dulaunoy's avatar Alexandre Dulaunoy
Browse files

NIST vendor statement not more available in uncompressed format

parent 701ac050
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -69,12 +69,12 @@ ch = VendorHandler()
parser.setContentHandler(ch)
# check modification date
try:
    f = Configuration.getFile(vendordict)
    (f, r) = Configuration.getFile(vendordict, compressed = True)
except:
    sys.exit("Cannot open url %s. Bad URL or not connected to the internet?"%(vendordict))
i = info.find_one({'db': 'vendor'})
if i is not None:
    if f.headers['last-modified'] == i['last-modified']:
    if r.headers['last-modified'] == i['last-modified']:
        print("Not modified")
        sys.exit(0)
# parse xml and store in database
@@ -87,4 +87,4 @@ for statement in progressbar(ch.vendor):
bulk.execute()

#update database info after successful program-run
info.update({'db': 'vendor'}, {"$set": {'last-modified': f.headers['last-modified']}}, upsert=True)
info.update({'db': 'vendor'}, {"$set": {'last-modified': r.headers['last-modified']}}, upsert=True)