Fix __salt__ unavailable in __virtual__()

In older versions of Salt (this was originally developed against 2015.2),
__salt__ isn't loaded yet in the __virtual__() function. Work around this by
just duplicating the check from upstream postgres.py
This commit is contained in:
Brian Jackson
2015-05-05 11:42:43 -05:00
parent eda4cf69ae
commit 5015024725

View File

@@ -16,7 +16,7 @@ def __virtual__():
''' '''
Only load this module if the postgres module is already loaded Only load this module if the postgres module is already loaded
''' '''
if 'postgres.psql_query' in __salt__: if all((salt.utils.which('psql'), HAS_ALL_IMPORTS)):
return True return True
return False return False