saltstack/salt — pull request #8777 by miroswan (2013-11-23 17:52:16+00:00)
Title: Fixed launchctl module

launchctl.py kept churning out exceptions in regard to \_available\_services. The error complained about the file (Launch Agent or Launch Daemon) not being found. When running ls -hl on the problematic files, I found that they were symbolic links in the LaunchAgent/LaunchDaemon directories. To get around this problem, I've added a with(open) statement, wrapping the file\_path in os.path.realpath and assigning that to true\_path. This resolved the exception issue since it first checks to see if the file cab be opened, then follows the symbolic links if there are any. Now anything that calls \_available\_services within this module should work.