Merge pull request #437 from rosowiecki/devel

Using get_bin_path to find rmmod and modprobe
This commit is contained in:
Brian Coca 2015-04-30 11:54:17 -04:00
commit dd80fa221c

View file

@ -97,13 +97,13 @@ def main():
# Add/remove module as needed
if args['state'] == 'present':
if not present:
rc, _, err = module.run_command(['modprobe', args['name'], args['params']])
rc, _, err = module.run_command([module.get_bin_path('modprobe', True), args['name'], args['params']])
if rc != 0:
module.fail_json(msg=err, **args)
args['changed'] = True
elif args['state'] == 'absent':
if present:
rc, _, err = module.run_command(['rmmod', args['name']])
rc, _, err = module.run_command([module.get_bin_path('rmmod', True), args['name']])
if rc != 0:
module.fail_json(msg=err, **args)
args['changed'] = True