From 0b20cab18431897f73b09f4e76ade3d019b325cf Mon Sep 17 00:00:00 2001 From: Vishwesh Date: Tue, 25 Oct 2022 11:31:03 -0400 Subject: [PATCH] fix: Iterating over pid_cpu_usage dictionary The code tries to iterate over pid_cpu_usage in line 82, but uses an incorrect method to iterate giving rise to the error: ValueError: not enough values to unpack (expected 2, got 1) --- procfs_sensor/__main__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/procfs_sensor/__main__.py b/procfs_sensor/__main__.py index 1689d30..3b023b9 100644 --- a/procfs_sensor/__main__.py +++ b/procfs_sensor/__main__.py @@ -79,7 +79,7 @@ def sensor_mesure_send(sampling_interval, sensor, target, sock): cgroup_cpu_usage = {} global_cpu_usage = 0 - for process, _ in pid_cpu_usage: + for process in pid_cpu_usage: global_cpu_usage += float(pid_cpu_usage[process].replace(", ", ".")) for cgroup in target: