fix: handle nested and flat fw.conf formats
This commit is contained in:
parent
350434e690
commit
b3cf1c8250
1 changed files with 4 additions and 2 deletions
|
|
@ -105,10 +105,12 @@ def container_status():
|
||||||
|
|
||||||
def deploy_all():
|
def deploy_all():
|
||||||
cfg = load_config()
|
cfg = load_config()
|
||||||
if not cfg.get("nodes"):
|
nodes = cfg.get("nodes", cfg) # support both {"nodes":{...}} and flat format
|
||||||
|
if not nodes:
|
||||||
print("No nodes in fw.conf")
|
print("No nodes in fw.conf")
|
||||||
return
|
return
|
||||||
for name, nc in cfg.items():
|
for name, nc in nodes.items():
|
||||||
|
if not isinstance(nc, dict): continue
|
||||||
deploy_container(name, nc["token"], nc.get("cloud","EU"),
|
deploy_container(name, nc["token"], nc.get("cloud","EU"),
|
||||||
str(nc.get("port","8081")), nc.get("upstream_ip","127.0.0.1"),
|
str(nc.get("port","8081")), nc.get("upstream_ip","127.0.0.1"),
|
||||||
str(nc.get("upstream_port","80")), nc.get("labels",""),
|
str(nc.get("upstream_port","80")), nc.get("labels",""),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue