mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Add __virtual__ functions for pecl and pip states
Similar to what was recently done for npm, disable pecl and pip states when the needed binary is not available. This prevents tracebacks when one tries running these states without the required shell command installed.
This commit is contained in:
parent
91e80bc994
commit
a9e061540c
@ -11,6 +11,13 @@ A state module to manage php pecl extensions.
|
||||
'''
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load if the pecl module is available in __salt__
|
||||
'''
|
||||
return 'pecl' if 'pecl.list' in __salt__ else False
|
||||
|
||||
|
||||
def installed(name,
|
||||
version=None,
|
||||
defaults=False):
|
||||
|
@ -16,6 +16,13 @@ import urlparse
|
||||
from salt.exceptions import CommandExecutionError, CommandNotFoundError
|
||||
|
||||
|
||||
def __virtual__():
|
||||
'''
|
||||
Only load if the pip module is available in __salt__
|
||||
'''
|
||||
return 'pip' if 'pip.list' in __salt__ else False
|
||||
|
||||
|
||||
def installed(name,
|
||||
pip_bin=None,
|
||||
requirements=None,
|
||||
|
Loading…
Reference in New Issue
Block a user