mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Fix psutil.cpu_times unpack error (#34318)
This commit is contained in:
parent
1398b1c51e
commit
e168b05a87
@ -133,6 +133,8 @@ def top(num_processes=5, interval=3):
|
||||
try:
|
||||
process = psutil.Process(pid)
|
||||
user, system = process.cpu_times()
|
||||
except ValueError:
|
||||
user, system, _, _ = process.cpu_times()
|
||||
except psutil.NoSuchProcess:
|
||||
continue
|
||||
start_usage[process] = user + system
|
||||
@ -141,6 +143,8 @@ def top(num_processes=5, interval=3):
|
||||
for process, start in six.iteritems(start_usage):
|
||||
try:
|
||||
user, system = process.cpu_times()
|
||||
except ValueError:
|
||||
user, system, _, _ = process.cpu_times()
|
||||
except psutil.NoSuchProcess:
|
||||
continue
|
||||
now = user + system
|
||||
|
Loading…
Reference in New Issue
Block a user