summaryrefslogtreecommitdiff
path: root/utils.py
diff options
context:
space:
mode:
Diffstat (limited to 'utils.py')
-rw-r--r--utils.py16
1 files changed, 12 insertions, 4 deletions
diff --git a/utils.py b/utils.py
index 06c6500..bc47d8f 100644
--- a/utils.py
+++ b/utils.py
@@ -32,14 +32,22 @@ def write_facts(ruleset: set):
os.mkdir(typedir)
fs = []
- for f in facts:
- if f["type"] != t:
+ for fact in facts:
+ if fact["type"] != t:
continue
+
+ if fact["type"] == "meta":
+ continue
+
+ if fact.get("key") is None:
+ raise Exception(f"Bad fact: no 'key' {fact}")
+
try:
- del f["sid"]
+ del fact["sid"]
except KeyError:
pass
- fs.append(f)
+
+ fs.append(fact)
i = 0
for fact in sorted(fs, key=lambda f: f["key"]):