diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2020-12-28 21:56:05 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2020-12-28 21:56:05 +0100 |
commit | 9851dffc8d915ff01117a5ed8070e5b2a1ef2bb5 (patch) | |
tree | 6fe7914b793a782079738a936bac595a08902b44 /utils.py | |
parent | b8af5cdf274a60f364d34192d4f483f4f4800282 (diff) | |
download | rules-sandbox-9851dffc8d915ff01117a5ed8070e5b2a1ef2bb5.tar.gz rules-sandbox-9851dffc8d915ff01117a5ed8070e5b2a1ef2bb5.tar.bz2 rules-sandbox-9851dffc8d915ff01117a5ed8070e5b2a1ef2bb5.tar.xz rules-sandbox-9851dffc8d915ff01117a5ed8070e5b2a1ef2bb5.zip |
Better structure.
Splitting machines and terraform machines, ditto with dns.
Diffstat (limited to 'utils.py')
-rw-r--r-- | utils.py | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -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"]): |