From 0f1ac76bcc20dc2291559dac7182de3788fef1f1 Mon Sep 17 00:00:00 2001 From: Antoine Van Elstraete Date: Tue, 28 Dec 2021 00:16:04 +0100 Subject: [PATCH] code practices --- knot_ | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/knot_ b/knot_ index ffbc0b0..fadf50c 100755 --- a/knot_ +++ b/knot_ @@ -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