bundles/sshmon: fix SyntaxWarning

This commit is contained in:
Franzi 2024-09-27 10:22:58 +02:00
parent 67f901c1c9
commit 8ba63e112c
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -12,7 +12,7 @@ try:
top_output = check_output(rf"top -b -n{ITERATIONS} -d1 | grep -i '^%cpu'", shell=True).decode('UTF-8') top_output = check_output(rf"top -b -n{ITERATIONS} -d1 | grep -i '^%cpu'", shell=True).decode('UTF-8')
cpu_usage = {} cpu_usage = {}
for value, identifier in findall('([0-9\.\,]{3,5}) ([a-z]{2})', top_output): for value, identifier in findall(r'([0-9\.\,]{3,5}) ([a-z]{2})', top_output):
if identifier not in cpu_usage: if identifier not in cpu_usage:
cpu_usage[identifier] = 0.0 cpu_usage[identifier] = 0.0
cpu_usage[identifier] += float(value.replace(',', '.')) cpu_usage[identifier] += float(value.replace(',', '.'))