2020-02-23 10:13:45 +00:00
|
|
|
from os.path import join
|
|
|
|
from pathlib import Path
|
|
|
|
|
|
|
|
nodes = {}
|
|
|
|
for node in Path(join(repo_path, "nodes")).rglob("*.py"):
|
|
|
|
with open(node, 'r') as f:
|
|
|
|
exec(f.read())
|
2020-03-27 12:28:37 +00:00
|
|
|
|
|
|
|
for name, data in nodes.items():
|
|
|
|
if 'hostname' not in data.keys():
|
|
|
|
data['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'
|
2020-10-25 10:07:23 +00:00
|
|
|
|
|
|
|
if 'hostname' not in data['metadata'].keys():
|
|
|
|
data['metadata']['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'
|