Fix ng-killall by swallowing psutil exceptions in filter
Review Request #4237 - Created Sept. 14, 2016 and submitted
|Nick Howard (Twitter)|
|jsirois, kwlzn, zundel|
ng-killall will fail to kill nailguns if there is a process earlier in the process list that has attributes that can't be accessed. This patch wraps ProcessManager.process_iter's filter with a exception swallow call which allows it to continue if the filter calls a psutil error causing method.
Wrote unit tests exhibiting the behavior I was seeing and made them pass. Tried running ng-killall after the change and saw it work.
Change to jsirois' suggested impl. Add a docstring describing error swallowing.
Revision 2 (+44 -4)