Initial SUSE CSAF mirror
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import re
|
||||
from pathlib import Path
|
||||
from sys import exit
|
||||
root=Path(__file__).resolve().parent.parent
|
||||
state=root/'state'/'sync.json'
|
||||
if not state.exists():raise SystemExit('Kein Sync-Status vorhanden')
|
||||
s=json.loads(state.read_text())
|
||||
assert s.get('documents')==len(s.get('index',[]))
|
||||
files=list((root/'data'/'csaf').glob('*/*.json'))
|
||||
if len(files)!=s['documents']:
|
||||
raise SystemExit(f'Unvollständig: {len(files)} Dateien, {s["documents"]} erwartet')
|
||||
for p in files:
|
||||
obj=json.loads(p.read_bytes())
|
||||
if not isinstance(obj.get('document'),dict):raise SystemExit(f'CSAF ungültig: {p}')
|
||||
print(f'VALID: {len(files)} CSAF-Dokumente')
|
||||
Reference in New Issue
Block a user