mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Show how to use __virtualname__
This commit is contained in:
parent
e26d7f1db9
commit
ba80b2ecfa
1 changed files with 3 additions and 1 deletions
|
@ -100,10 +100,12 @@ loaded as simply ``redis``:
|
|||
except ImportError:
|
||||
HAS_REDIS = False
|
||||
|
||||
__virtualname__ = 'redis'
|
||||
|
||||
def __virtual__():
|
||||
if not HAS_REDIS:
|
||||
return False
|
||||
return 'redis'
|
||||
return __virtualname__
|
||||
|
||||
Full List of Returners
|
||||
======================
|
||||
|
|
Loading…
Add table
Reference in a new issue