3rd time's the charm

This commit is contained in:
Elliot Matson 2022-07-29 23:56:28 -05:00
parent 7d44729c6e
commit c75fc233fe

View File

@ -2,12 +2,13 @@ import json
import os import os
import time import time
with open('/config/servers.json', 'w') as f: with open("/config/servers.json", "w") as f:
print("created " + f.name) print("created " + f.name)
template_string = ('{"Servers": {"1": {"Name": "DavinciResolve", ' template_string = (
'"Group": "Servers", "Port": 5432, "Username": ' '{"Servers": {"1": {"Name": "DavinciResolve", '
'"postgres", "Host": "postgres", "SSLMode": "prefer", "MaintenanceDB": "postgres"}}}' '"Group": "Servers", "Port": 5432, "Username": '
) '"postgres", "Host": "postgres", "SSLMode": "prefer", "MaintenanceDB": "postgres"}}}'
)
data = json.loads(template_string) data = json.loads(template_string)
data["Servers"]["1"]["Username"] = os.getenv("POSTGRES_USER") data["Servers"]["1"]["Username"] = os.getenv("POSTGRES_USER")
print("printing json to file...") print("printing json to file...")