initial commit

This commit is contained in:
Franzi 2021-11-26 19:45:23 +01:00
commit 35a1d52840
Signed by: kunsi
GPG key ID: 12E3D2136B818350
20 changed files with 238 additions and 0 deletions

17
nodes.py Normal file
View file

@ -0,0 +1,17 @@
from json import dumps as json_dumps
from os.path import join
from pathlib import Path
import bwpass
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'