diff --git a/lib/ansible/modules/system/pids.py b/lib/ansible/modules/system/pids.py index fe861998b44..80b48a1a2d4 100644 --- a/lib/ansible/modules/system/pids.py +++ b/lib/ansible/modules/system/pids.py @@ -53,7 +53,7 @@ except ImportError: def get_pid(name): - return [p.info['pid'] for p in psutil.process_iter(attrs=['pid', 'name']) if name == p.info['name']] + return [p.info['pid'] for p in psutil.process_iter(attrs=['pid', 'name']) if p.info and p.info.get('name', None) and p.info['name'].lower() == name.lower()] def main():