bundlewrap/nodes.py
Franzi 5476c9c8f2
All checks were successful
bundlewrap/pipeline/head This commit looks good
bundlewrap/pipeline/pr-main This commit looks good
nodes/htz.ex42-1048908: get passwords from bwpass
2021-04-16 16:25:34 +02:00

17 lines
482 B
Python

from os.path import join
from pathlib import Path
import bwpass
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'
if 'hostname' not in data['metadata'].keys():
data['metadata']['hostname'] = '.'.join(reversed(name.split('.'))) + '.kunbox.net'