mirror of https://github.com/MISP/misp-modules
Merge branch 'cof2misp' of github.com:aaronkaplan/misp-modules into cof2misp
commit
36904c688c
|
@ -161,12 +161,12 @@ def is_dnsdbflex(data: str) -> bool:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
j = ndjson.loads(data)
|
j = ndjson.loads(data)
|
||||||
for l in j:
|
for line in j:
|
||||||
if not set(l.keys()) == {'rrname', 'rrtype'}:
|
if not set(line.keys()) == {'rrname', 'rrtype'}:
|
||||||
return False # shortcut
|
return False # shortcut. We assume it's not if a single line does not conform
|
||||||
return True
|
return True
|
||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
print("oops, this should not have happened. Maybe not an ndjson file?", file=sys.sterr)
|
print("oops, this should not have happened. Maybe not an ndjson file? Reason: %s" % (str(ex),), file=sys.sterr)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue