mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Expand error message for postgres states
Also revert pg_bin back to bins_dir
This commit is contained in:
parent
ac72ee600e
commit
1aa43eba80
11 changed files with 31 additions and 11 deletions
|
@ -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?
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Reference in a new issue