Clean up logic
This commit is contained in:
parent
253da228f7
commit
921a712510
@ -4,12 +4,10 @@ import time
|
||||
|
||||
# quit if config file already exists
|
||||
if os.path.exists("/config/servers.json"):
|
||||
print("/config/servers.json already exists. Quitting...")
|
||||
quit()
|
||||
|
||||
|
||||
# open json file in docker volume
|
||||
with open("/config/servers.json", "w") as f:
|
||||
print("/config/servers.json already exists.")
|
||||
else:
|
||||
# open json file in docker volume
|
||||
with open("/config/servers.json", "w") as f:
|
||||
print("created " + f.name)
|
||||
# template json string
|
||||
template_string = (
|
||||
@ -20,11 +18,12 @@ with open("/config/servers.json", "w") as f:
|
||||
data = json.loads(template_string)
|
||||
# fix username
|
||||
data["Servers"]["1"]["Username"] = os.getenv("POSTGRES_USER")
|
||||
print("printing json to file...")
|
||||
print("Printing json to file...")
|
||||
print(data)
|
||||
# update config file
|
||||
json.dump(data, f, indent=2)
|
||||
|
||||
print("Done. Sleeping...")
|
||||
|
||||
# Sleep until GHA Healthchecks are complete.
|
||||
# I'm sure there's a better way to get this to not
|
||||
|
Loading…
Reference in New Issue
Block a user