Merge pull request #7405 from terminalmage/issue7371

Don't make pkg/service states available unless provider module is loaded
This commit is contained in:
Pedro Algarvio 2013-09-23 02:16:05 -07:00
commit b60c5b065e
2 changed files with 11 additions and 2 deletions

View File

@ -61,6 +61,14 @@ if salt.utils.is_windows():
log = logging.getLogger(__name__)
def __virtual__():
'''
Only make these states available if a pkg provider has been detected or
assigned for this minion
'''
return 'pkg' if 'pkg.install' in __salt__ else False
def __gen_rtag():
'''
Return the location of the refresh tag

View File

@ -39,9 +39,10 @@ service, then set the reload value to True:
def __virtual__():
'''
Ensure that the service state returns the correct name
Only make these states available if a service provider has been detected or
assigned for this minion
'''
return 'service'
return 'service' if 'service.start' in __salt__ else False
def _enabled_used_error(ret):