%PDF- %PDF-
| Direktori : /proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/ |
| Current File : //proc/self/root/proc/self/root/usr/lib/python2.7/site-packages/salt/states/postgres_tablespace.pyo |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l j j Z d d l m Z d � Z
d d d d d d d d d � Z d d d d d d d � Z
d S( 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 ( t absolute_importt unicode_literalst print_functionN( t iteritemsc C@ s d t k r t d f St S( uV
Only load if the postgres module is present and is new enough (has ts funcs)
u postgres.tablespace_existsuF Unable to load postgres module. Make sure `postgres.bins_dir` is set.( t __salt__t Falset True( ( ( sC /usr/lib/python2.7/site-packages/salt/states/postgres_tablespace.pyt __virtual__ s
c
C@ s� i | d 6i d 6t d 6d j | � d 6}
i | d 6| d 6| d 6| d 6| d
6| d 6} t d | � } | | k r� t d
r� d |
d <d j | � |
d <|
St d | | | | | � r� d j | � |
d <d |
d | <|
Sn | | d | k r&t d
r&d j | � |
d <t |
d <|
S| r�| | d | k r�t d
rkd |
d <d j | � |
d <n t d | d | �r�t d
r�d j | � |
d <i | d 6|
d | <t |
d <q�n | r�x� t | � D]� \ }
} d j |
| � | | d k r�t d
r.d |
d <d j | � |
d <Pn t d | d i | |
6�r�d j | � |
d <t j |
d i i i | |
6d 6| 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
u nameu changesu resultu! Tablespace {0} is already presentu commentu maintenance_dbu runasu hostu useru portu passwordu postgres.tablespace_listu testu# Tablespace {0} is set to be createdu postgres.tablespace_createu# The tablespace {0} has been createdu Presentu Locationuz Tablespace {0} is not at the right location. This is
unfixable without dropping and recreating the tablespace.u Owneru"