From c7e3aee0f018c019860cf6f17ffa9be9b12b7155 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 11 Feb 2015 17:21:35 -0500 Subject: [PATCH] now properly checks that link is suplied before trying to use it should fix #46 --- system/alternatives.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/system/alternatives.py b/system/alternatives.py index 575cb572867..871a494e87d 100755 --- a/system/alternatives.py +++ b/system/alternatives.py @@ -136,10 +136,13 @@ def main(): # install the requested path if necessary # (unsupported on the RedHat version) if path not in all_alternatives and os_family == "Debian": - module.run_command( - [UPDATE_ALTERNATIVES, '--install', link, name, path, str(DEFAULT_LINK_PRIORITY)], - check_rc=True - ) + if link: + module.run_command( + [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 module.run_command(