%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //lib/python2.7/site-packages/salt/states/postgres_tablespace.pyo

�
���^c	@@s�dZddlmZmZmZddljjZddlm	Z	d�Z
ddddddddd�Zddddddd�Z
dS(u+
Management of PostgreSQL tablespace
===================================

A module used to create and manage PostgreSQL tablespaces.

.. code-block:: yaml

    ssd-tablespace:
      postgres_tablespace.present:
        - name: indexes
        - directory: /mnt/ssd-data

.. versionadded:: 2015.8.0

i(tabsolute_importtunicode_literalstprint_functionN(t	iteritemscC@sdtkrtdfStS(uV
    Only load if the postgres module is present and is new enough (has ts funcs)
    upostgres.tablespace_existsuFUnable to load postgres module.  Make sure `postgres.bins_dir` is set.(t__salt__tFalsetTrue(((sC/usr/lib/python2.7/site-packages/salt/states/postgres_tablespace.pyt__virtual__s
c
C@s�i|d6id6td6dj|�d6}
i|d6|d6|d6|	d	6|d
6|d6}td|�}||kr�td
r�d |
d<dj|�|
d<|
Std|||||�r�dj|�|
d<d|
d|<|
Sn||d|kr&td
r&dj|�|
d<t|
d<|
S|r�||d|kr�td
rkd |
d<dj|�|
d<ntd|d|�r�td
r�dj|�|
d<i|d6|
d|<t|
d<q�n|r�x�t|�D]�\}
}dj|
|�||dkr�td
r.d |
d<dj|�|
d<Pntd|di||
6�r�dj|�|
d<tj|
diii||
6d6|6�t|
d<q�q�q�Wn|
S(!uo
    Ensure that the named tablespace is present with the specified properties.
    For more information about all of these options run ``man 7
    create_tablespace``.

    name
        The name of the tablespace to create/manage.

    directory
        The directory where the tablespace will be located, must already exist

    options
        A dictionary of options to specify for the tablespace.
        Currently, the only tablespace options supported are ``seq_page_cost``
        and ``random_page_cost``. Default values are shown in the example below:

        .. code-block:: yaml

            my_space:
              postgres_tablespace.present:
                - directory: /srv/my_tablespace
                - options:
                    seq_page_cost: 1.0
                    random_page_cost: 4.0

    owner
        The database user that will be the owner of the tablespace.
        Defaults to the user executing the command (i.e. the `user` option)

    user
        System user all operations should be performed on behalf of

    maintenance_db
        Database to act on

    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
    unameuchangesuresultu!Tablespace {0} is already presentucommentumaintenance_dburunasuhostuuseruportupasswordupostgres.tablespace_listutestu#Tablespace {0} is set to be createdupostgres.tablespace_createu#The tablespace {0} has been createduPresentuLocationuzTablespace {0} is not at the right location. This is
            unfixable without dropping and recreating the tablespace.uOwneru"Tablespace {0} owner to be alteredupostgres.tablespace_altert	new_owneruTablespace {0} owner changeduowneru{0}={1}uOptsu<Tablespace {0} options to be
                        alteredt
set_optionuTablespace {0} opts changeduoptionsN(	RtformatRt__opts__tNoneRRt
dictupdatetupdate(tnamet	directorytoptionstownertusertmaintenance_dbtdb_passwordtdb_hosttdb_porttdb_usertrettdbargst	tblspacestktv((sC/usr/lib/python2.7/site-packages/salt/states/postgres_tablespace.pytpresent&sb9







 


)c	C@s�i|d6id6td6dd6}i|d6|d6|d6|d	6|d
6|d6}td||�r�td
r�d|d<dj|�|d<|Std||�r�dj|�|d<d|d|<|Sndj|�|d<|S(u

    Ensure that the named tablespace is absent.

    name
        The name of the tablespace to remove

    user
        System user all operations should be performed on behalf of

    maintenance_db
        Database to act on

    db_user
        Database username if different from config or defaul

    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
    unameuchangesuresultuucommentumaintenance_dburunasuhostuuseruportupasswordupostgres.tablespace_existsutestu#Tablespace {0} is set to be removedupostgres.tablespace_removeuTablespace {0} has been removeduAbsentu6Tablespace {0} is not present, so it cannot be removedN(RRRRR
(	RRRRRRRRtdb_args((sC/usr/lib/python2.7/site-packages/salt/states/postgres_tablespace.pytabsent�s.





(t__doc__t
__future__RRRtsalt.utils.dictupdatetutilsR
tsalt.ext.sixRRRRR (((sC/usr/lib/python2.7/site-packages/salt/states/postgres_tablespace.pyt<module>s$	s

Zerion Mini Shell 1.0