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:
@@ -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
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user