Skip to content

Commit

Permalink
Exception handling from psutil for processes that go missing.
Browse files Browse the repository at this point in the history
Refs #9274.
  • Loading branch information
Mike Place authored and basepi committed Dec 18, 2013
1 parent b340d8c commit 7fdca69
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion salt/modules/ps.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ def top(num_processes=5, interval=3):
for pid in psutil.get_pid_list():
try:
process = psutil.Process(pid)
user, system = process.get_cpu_times()
except psutil.NoSuchProcess:
continue
user, system = process.get_cpu_times()
start_usage[process] = user + system
time.sleep(interval)
usage = set()
Expand Down

0 comments on commit 7fdca69

Please sign in to comment.