Commit 58620ca4 by David Stygstra

Add Python 2.4 support to modprobe module

parent 27a08dc6
...@@ -57,9 +57,14 @@ def main(): ...@@ -57,9 +57,14 @@ def main():
# Check if module is present # Check if module is present
try: try:
with open('/proc/modules') as modules: modules = open('/proc/modules')
present = any(module.startswith(args['name'] + ' ') for module in modules) present = False
except IOError as e: for line in modules:
if line.startswith(args['name'] + ' '):
present = True
break
modules.close()
except IOError, e:
module.fail_json(msg=str(e), **args) module.fail_json(msg=str(e), **args)
# Check only; don't modify # Check only; don't modify
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment