%PDF- %PDF-
| Direktori : /proc/self/root/proc/3522530/root/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/3522530/root/lib/python2.7/site-packages/salt/states/postgres_schema.pyo |
�
���^c @@ s} d Z d d l m Z m Z m Z d d l Z e j e � Z d � Z d d d d d d d � Z d d d d d d � Z d S( u�
Management of PostgreSQL schemas
================================
The postgres_schemas module is used to create and manage Postgres schemas.
.. code-block:: yaml
public:
postgres_schema.present 'dbname' 'name'
i ( t absolute_importt unicode_literalst print_functionNc C@ s d t k r t d f St S( u5
Only load if the postgres module is present
u postgres.schema_existsuF Unable to load postgres module. Make sure `postgres.bins_dir` is set.( t __salt__t Falset True( ( ( s? /usr/lib/python2.7/site-packages/salt/states/postgres_schema.pyt __virtual__ s
c
C@ sO i | d 6| d 6i d 6t d 6d j | | � d 6} i | d 6| d 6| d 6| d
6| d 6} t d | | | � }
d } |
d k r� t d
r� d | d <d j | | � | d <| St d | | d | | �} n d } d } | rd } t | d <d | d | <n/ | d k r%d } t | d <n d } t | d <| j | | � | d <| S( u
Ensure that the named schema is present in the database.
dbname
The database's name will work on
name
The name of the schema to manage
user
system user all operations should be performed on behalf of
db_user
database username if different from config or default
db_password
user password if any password for a specified user
db_host
Database host if different from config or default
db_port
Database port if different from config or default
u dbnameu nameu changesu resultu- Schema {0} is already present in database {1}u commentu db_useru db_passwordu db_hostu db_portu useru postgres.schema_getu testu0 Schema {0} is set to be created in database {1}.u postgres.schema_createt owneru) Schema {0} already exists in database {1}u+ Schema {0} has been created in database {1}u Presentu+ Failed to create schema {0} in database {1}N( R t formatR t Nonet __opts__R (
t dbnamet nameR t usert db_usert db_passwordt db_hostt db_portt rett db_argst schema_attrt crett msg( ( s? /usr/lib/python2.7/site-packages/salt/states/postgres_schema.pyt present sJ
c C@ s i | d 6| d 6i d 6t d 6d d 6} i | d 6| d 6| d 6| d
6| d 6} t d | | | � r� t d
r� d | d <d j | | � | d <| St d | | | � r� d j | | � | d <d | d | <| St | d <d j | � | d <| Sn d j | | � | d <| S( u
Ensure that the named schema is absent.
dbname
The database's name will work on
name
The name of the schema to remove
user
system user all operations should be performed on behalf of
db_user
database username if different from config or default
db_password
user password if any password for a specified user
db_host
Database host if different from config or default
db_port
Database port if different from config or default
u nameu dbnameu changesu resultu u commentu db_useru db_passwordu db_hostu db_portu useru postgres.schema_existsu testu1 Schema {0} is set to be removed from database {1}u postgres.schema_removeu- Schema {0} has been removed from database {1}u Absentu Schema {0} failed to be removeduB Schema {0} is not present in database {1}, so it cannot be removedN( R R R
R R R ( R R R
R R R R R R ( ( s? /usr/lib/python2.7/site-packages/salt/states/postgres_schema.pyt absentm s8
(
t __doc__t
__future__R R R t loggingt getLoggert __name__t logR R R R ( ( ( s? /usr/lib/python2.7/site-packages/salt/states/postgres_schema.pyt <module> s
K