saltstack/salt — pull request #5932 by terminalmage (2013-07-03 23:16:16+00:00)
Title: Clear cached service data at the beginning of service states

This fixes an edge case where service data has already been discovered
in another service state within the same highstate run, causing the
cached service data to be stored in __context__. If a package is then
installed which also adds a service, and a service state is run for that
service name, the list of available services will return cached data,
and salt will think that the service does not exist. By clearing the
cache at the beginning of the service states, we ensure that the most
up-to-date service information is used for service states.