nodes.py: autogenerate hostname if not set in nodefile

This commit is contained in:
Franzi 2020-03-27 12:28:37 +00:00
parent 067b498bf2
commit ae82e9cd51
Signed by: kunsi
GPG key ID: 12E3D2136B818350
3 changed files with 4 additions and 2 deletions

View file

@ -5,3 +5,7 @@ nodes = {}
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'