Expand error message for postgres states

Also revert pg_bin back to bins_dir
This commit is contained in:
Daniel Wallace 2016-12-01 09:40:00 -06:00
parent ac72ee600e
commit 1aa43eba80
11 changed files with 31 additions and 11 deletions

View file

@ -25,7 +25,7 @@ Module to provide Postgres compatibility to salt.
automatically placed on the path. Add a configuration to the location
of the postgres bin's path to the relevant minion for this module::
postgres.pg_bin: '/usr/pgsql-9.5/bin/'
postgres.bins_dir: '/usr/pgsql-9.5/bin/'
'''
# This pylint error is popping up where there are no colons?

View file

@ -20,7 +20,9 @@ def __virtual__():
'''
Only load if the deb_postgres module is present
'''
return 'postgres.cluster_exists' in __salt__
if 'postgres.cluster_exists' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(version,

View file

@ -18,7 +18,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.user_exists' in __salt__
if 'postgres.user_exists' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,

View file

@ -28,7 +28,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.create_extension' in __salt__
if 'postgres.create_extension' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,

View file

@ -28,7 +28,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.group_create' in __salt__
if 'postgres.group_create' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,

View file

@ -28,7 +28,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.datadir_init' in __salt__
if 'postgres.datadir_init' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,

View file

@ -28,7 +28,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.language_create' in __salt__
if 'postgres.language_create' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,

View file

@ -71,7 +71,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.privileges_grant' in __salt__
if 'postgres.privileges_grant' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,

View file

@ -23,7 +23,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.schema_exists' in __salt__
if 'postgres.schema_exists' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(dbname, name,

View file

@ -30,7 +30,9 @@ def __virtual__():
'''
Only load if the postgres module is present and is new enough (has ts funcs)
'''
return 'postgres.tablespace_exists' in __salt__
if 'postgres.tablespace_exists' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,

View file

@ -28,7 +28,9 @@ def __virtual__():
'''
Only load if the postgres module is present
'''
return 'postgres.user_exists' in __salt__
if 'postgres.user_exists' not in __salt__:
return (False, 'Unable to load postgres module. Make sure `postgres.bins_dir` is set.')
return True
def present(name,