From e428441a1d971e9d42f1fd681493e7d9a7a5a221 Mon Sep 17 00:00:00 2001 From: abyss Date: Thu, 14 Mar 2019 18:27:20 +0530 Subject: [PATCH] pids: case insensitive string comparison for process names (#52564) --- lib/ansible/modules/system/pids.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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():