Skip to content

Commit

Permalink
Merge pull request #32182 from dongweiming/fix-ps
Browse files Browse the repository at this point in the history
Fix psutil.cpu_times unpack error
  • Loading branch information
Mike Place committed Mar 28, 2016
2 parents b60b6f9 + ea67120 commit c983974
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions salt/modules/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit c983974

Please sign in to comment.