mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
states.service.__virtual__: add load fail reason
This commit is contained in:
parent
9f56ab4c45
commit
6a9ae09e79
1 changed files with 9 additions and 1 deletions
|
@ -62,13 +62,21 @@ service, then set the reload value to True:
|
|||
from __future__ import absolute_import
|
||||
import time
|
||||
|
||||
__virtualname__ = 'service'
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only make these states available if a service provider has been detected or
|
||||
assigned for this minion
|
||||
'''
|
||||
return 'service.start' in __salt__
|
||||
if 'service.start' in __salt__:
|
||||
return __virtualname__
|
||||
else:
|
||||
return (False, 'No service execution module loaded: '
|
||||
'check support for service management on {0} '
|
||||
''.format(__grains__.get('osfinger', __grains__['os']))
|
||||
)
|
||||
|
||||
|
||||
def _enabled_used_error(ret):
|
||||
|
|
Loading…
Add table
Reference in a new issue