From 501502472584a459bcbecb2bf5a005bc449e6f6a Mon Sep 17 00:00:00 2001 From: Brian Jackson Date: Tue, 5 May 2015 11:42:43 -0500 Subject: [PATCH] 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 --- _modules/postgres_ext.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_modules/postgres_ext.py b/_modules/postgres_ext.py index 89666fa..3165487 100644 --- a/_modules/postgres_ext.py +++ b/_modules/postgres_ext.py @@ -16,7 +16,7 @@ def __virtual__(): ''' 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 False