Add docs for new raw boolean support of depends decorator

This commit is contained in:
Thomas Jackson 2015-03-05 22:02:34 -08:00
parent 9fa37fd46b
commit b8e39c13f9

View File

@ -336,3 +336,20 @@ If a "fallback_function" is defined, it will replace the function instead of rem
replaced with "_fallback"
'''
return True
In addition to global dependancies the depends decorator also supports raw booleans.
.. code-block:: python
from salt.utils.decorators import depends
HAS_DEP = False
try:
import dependency_that_sometimes_exists
HAS_DEP = True
except ImportError:
pass
@depends(HAS_DEP)
def foo():
return True