saltstack/salt — pull request #6279 by terminalmage (2013-07-23 17:27:00+00:00)
Title: Fix alternatives.check_installed

This function used os.path.realpath(), which follows symlinks
recursively. This means that, when the path for the alternative is also
a symlink, alternatives.check_installed returns False since it follows
the symlinks all the way down to the actual binary.

Additionally, there was redundant code in check_installed() and
show_current(). This commit changes check_installed() so that it uses
show_current() to provide the redundant functionality, and makes
show_current() use os.readlink() instead, so that it only checks the
path to which the link points instead of recursively following symlinks

Fixes #6162.