code practices

This commit is contained in:
Antoine Van Elstraete 2021-12-28 00:16:04 +01:00
parent 3e3608960f
commit 0f1ac76bcc
Signed by: AntoineVe
GPG Key ID: E36069A977E2A9ED

3
knot_
View File

@ -34,6 +34,7 @@ def responses(stats, config):
for code in responses_stats:
print(f"{code}.value {responses_stats[code]}")
def proto(stats, config):
'''
This will show if ipv4 or ipv6 and if tcp or udp are used.
@ -69,7 +70,7 @@ if __name__ == '__main__':
munin_time = getenv('munin_time', 300)
with open(file, "r") as stats_file:
stats = yaml.safe_load(stats_file)
if not "mod-stats" in stats:
if "mod-stats" not in stats:
raise Exception("Please configure knot with mod-stats")
if len(argv) > 1 and argv[1] == "config":
config = True