-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathrun_util_validate_configs.py
More file actions
executable file
·30 lines (26 loc) · 1.06 KB
/
run_util_validate_configs.py
File metadata and controls
executable file
·30 lines (26 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from src.utils.exceptions import ConfigNotFoundException
if __name__ == '__main__':
try:
from src.utils.config_parsers.internal_parsed import \
InternalConf, MISSING_INTERNAL_CONFIG_FILES
if len(MISSING_INTERNAL_CONFIG_FILES) == 0:
print('Internal configuration is valid.')
else:
print('Config file {} is missing.'.format(
MISSING_INTERNAL_CONFIG_FILES[0]))
except ConfigNotFoundException as cnfe:
print(cnfe)
except KeyError as ke:
print('Internal configuration has missing section/key:', ke)
try:
from src.utils.config_parsers.user_parsed import UserConf, \
MISSING_USER_CONFIG_FILES
if len(MISSING_USER_CONFIG_FILES) == 0:
print('User configuration is valid.')
else:
print('Config file {} is missing.'.format(
MISSING_USER_CONFIG_FILES[0]))
except ConfigNotFoundException as cnfe:
print(cnfe)
except KeyError as ke:
print('User configuration has missing section/key:', ke)