mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 13:22:48 +00:00
pids: case insensitive string comparison for process names (#52564)
This commit is contained in:
@@ -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():
|
||||
|
||||
Reference in New Issue
Block a user