Add Python 2.4 support to modprobe module

reviewable/pr18780/r1
David Stygstra 11 years ago
parent d6a5e05a21
commit 86d4331e3b

@ -57,9 +57,14 @@ def main():
# Check if module is present
try:
with open('/proc/modules') as modules:
present = any(module.startswith(args['name'] + ' ') for module in modules)
except IOError as e:
modules = open('/proc/modules')
present = False
for line in modules:
if line.startswith(args['name'] + ' '):
present = True
break
modules.close()
except IOError, e:
module.fail_json(msg=str(e), **args)
# Check only; don't modify

Loading…
Cancel
Save