From 9851dffc8d915ff01117a5ed8070e5b2a1ef2bb5 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 28 Dec 2020 21:56:05 +0100 Subject: Better structure. Splitting machines and terraform machines, ditto with dns. --- utils.py | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'utils.py') 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"]): -- cgit v1.2.3