now properly checks that link is suplied before trying to use it should fix #46

This commit is contained in:
Brian Coca 2015-02-11 17:21:35 -05:00 committed by Matt Clay
parent f319bdbfa4
commit f5a1196cc7

View file

@ -136,10 +136,13 @@ def main():
# install the requested path if necessary # install the requested path if necessary
# (unsupported on the RedHat version) # (unsupported on the RedHat version)
if path not in all_alternatives and os_family == "Debian": if path not in all_alternatives and os_family == "Debian":
module.run_command( if link:
[UPDATE_ALTERNATIVES, '--install', link, name, path, str(DEFAULT_LINK_PRIORITY)], module.run_command(
check_rc=True [UPDATE_ALTERNATIVES, '--install', link, name, path, str(DEFAULT_LINK_PRIORITY)],
) check_rc=True
)
else:
module.fail_json("Needed to install the alternative, but unable to do so, as we are missking the link")
# select the requested path # select the requested path
module.run_command( module.run_command(