mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-04-02 08:43:10 +00:00
Merge pull request #6097 from mattjeffery/bug/modprobe_normalise_name
Normalise the module name when comparing against the module names in /proc/modules
This commit is contained in:
@@ -60,8 +60,9 @@ def main():
|
||||
try:
|
||||
modules = open('/proc/modules')
|
||||
present = False
|
||||
module_name = args['name'].replace('-', '_') + ' '
|
||||
for line in modules:
|
||||
if line.startswith(args['name'] + ' '):
|
||||
if line.startswith(module_name):
|
||||
present = True
|
||||
break
|
||||
modules.close()
|
||||
|
||||
Reference in New Issue
Block a user