Raise an exception if no mod-stats in knot

This commit is contained in:
Antoine Van Elstraete 2021-12-27 23:49:41 +01:00
parent 8990114eb3
commit d7f2926222
Signed by: AntoineVe
GPG Key ID: E36069A977E2A9ED

2
knot_
View File

@ -40,6 +40,8 @@ if __name__ == '__main__':
file = getenv('stats_file_path') file = getenv('stats_file_path')
with open(file, "r") as stats_file: with open(file, "r") as stats_file:
stats = yaml.safe_load(stats_file) stats = yaml.safe_load(stats_file)
if not "mod-stats" in stats:
raise Exception("Please configure knot with mod-stats")
if len(argv) > 1 and argv[1] == "config": if len(argv) > 1 and argv[1] == "config":
config = True config = True
else: else: