add error_context() to groups.py and nodes.py
This commit is contained in:
parent
bc4f6e507a
commit
39e9ececa2
2 changed files with 9 additions and 4 deletions
|
@ -1,7 +1,10 @@
|
|||
from os.path import join
|
||||
from pathlib import Path
|
||||
|
||||
from bundlewrap.utils import error_context
|
||||
|
||||
groups = {}
|
||||
for group in Path(join(repo_path, "groups")).rglob("*.py"):
|
||||
with open(group, 'r') as f:
|
||||
exec(f.read())
|
||||
with error_context(filename=str(group)):
|
||||
with open(group, 'r') as f:
|
||||
exec(f.read())
|
||||
|
|
6
nodes.py
6
nodes.py
|
@ -4,10 +4,12 @@ from pathlib import Path
|
|||
|
||||
import bwpass
|
||||
from bundlewrap.metadata import atomic
|
||||
from bundlewrap.utils import error_context
|
||||
|
||||
for node in Path(join(repo_path, "nodes")).rglob("*.py"):
|
||||
with open(node, 'r') as f:
|
||||
exec(f.read())
|
||||
with error_context(filename=str(node)):
|
||||
with open(node, 'r') as f:
|
||||
exec(f.read())
|
||||
|
||||
for name, data in nodes.items():
|
||||
data.setdefault('hostname', '.'.join(reversed(name.split('.'))) + '.kunbox.net')
|
||||
|
|
Loading…
Reference in a new issue