bundlewrap/nodes.py
Franzi d51cded72d
All checks were successful
bundlewrap/pipeline/head This commit looks good
nodes/home.router: use debian buster nginx repo for now
2021-05-15 06:58:42 +02:00

16 lines
496 B
Python

from os.path import join
from pathlib import Path
from bundlewrap.metadata import atomic
for node in Path(join(repo_path, "nodes")).rglob("*.py"):
with open(node, 'r') as f:
exec(f.read())
for name, data in nodes.items():
if 'hostname' not in data.keys():
data['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'
if 'hostname' not in data['metadata'].keys():
data['metadata']['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'