bundlewrap/nodes.py

17 lines
580 B
Python
Raw Normal View History

from json import dumps as json_dumps
2020-02-23 10:13:45 +00:00
from os.path import join
from pathlib import Path
import bwpass
from bundlewrap.metadata import atomic
from bundlewrap.utils import error_context
2020-02-23 10:13:45 +00:00
for node in Path(join(repo_path, "nodes")).rglob("*.py"):
with error_context(filename=str(node)):
with open(node, 'r') as f:
exec(f.read())
for name, data in nodes.items():
2022-01-04 10:33:18 +00:00
data.setdefault('hostname', '.'.join(reversed(name.split('.'))) + '.kunbox.net')
data.setdefault('metadata', {}).setdefault('hostname', '.'.join(reversed(name.split('.'))) + '.kunbox.net')