This commit is contained in:
Iain Learmonth 2023-01-21 15:15:07 +00:00
parent 6df0083842
commit 10ffdff2c3
14 changed files with 46 additions and 16 deletions

View file

@ -67,7 +67,8 @@ class ListAutomation(TerraformAutomation):
for pool in Pool.query.filter(Pool.destroyed.is_(None)).all():
for key, formatter in lists.items():
for obfuscate in [True, False]:
with open(os.path.join(self.working_dir, f"{key}.{pool.pool_name}{'.jsno' if obfuscate else '.json'}"),
with open(os.path.join(
self.working_dir, f"{key}.{pool.pool_name}{'.jsno' if obfuscate else '.json'}"),
'w', encoding="utf-8") as out:
out.write(json_encode(formatter(pool), obfuscate))
with open(os.path.join(self.working_dir, f"{key}.{pool.pool_name}{'.jso' if obfuscate else '.js'}"),