%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_extension.pyc |
�
���^c @@ s� d Z d d l m Z m Z m Z d d l Z d d l m Z e j e � Z
d � Z d d d d d d d d d d d �
Z
d d d d d d d d d d � Z d S( u�
Management of PostgreSQL extensions
===================================
A module used to install and manage PostgreSQL extensions.
.. code-block:: yaml
adminpack:
postgres_extension.present
.. versionadded:: 2014.7.0
i ( t absolute_importt unicode_literalst print_functionN( t postgresc C@ s d t k r t d f St S( u5
Only load if the postgres module is present
u postgres.create_extensionuF Unable to load postgres module. Make sure `postgres.bins_dir` is set.( t __salt__t Falset True( ( ( sB /usr/lib/python2.7/site-packages/salt/states/postgres_extension.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} d }
t d
| d | d | | �} t j | k } | r� d }
n t } t j | k r� x8 t j t j g D]! } | | k r� t } d }
q� q� Wn d } | s | rtt
d rCd | d <|
r?d j | |
� j d d � | d <n | St d d | d | d | d | d | | � } n | r�|
j d � r�d } n d } d j | |
| � | d <d j |
j
� | � | d | <n/ | d k rd j | |
� | d <t | d <n | S( u8
Ensure that the named extension is present.
.. note::
Before you can use the state to load an extension into a database, the
extension's supporting files must be already installed.
For more information about all of these options see ``CREATE EXTENSION`` SQL
command reference in the PostgreSQL documentation.
name
The name of the extension to be installed
if_not_exists
Add an ``IF NOT EXISTS`` parameter to the DDL statement
schema
Schema to install the extension into
ext_version
Version to install
from_version
Old extension version if already installed
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 Extension {0} is already presentu commentu maintenance_dbu runasu useru passwordu hostu portu createu postgres.create_metadatat schemat ext_versionu installu upgradeu testu Extension {0} is set to be {1}edu eedu edu postgres.create_extensiont namet
if_not_existst from_versionu eu du! The extension {0} has been {1}{2}u {0}{1}u Failed to {1} extension {0}N( R t formatR R t _EXTENSION_NOT_INSTALLEDR t _EXTENSION_INSTALLEDt _EXTENSION_TO_MOVEt _EXTENSION_TO_UPGRADEt Nonet __opts__t replacet endswitht
capitalize( R
R R R R t usert maintenance_dbt db_usert db_passwordt db_hostt db_portt rett db_argst modet mtdatat toinstallt toupgradet flagt crett suffix( ( sB /usr/lib/python2.7/site-packages/salt/states/postgres_extension.pyt present$ sj 7
#
c
C@ s i | d 6i d 6t d 6d d 6}
i | d 6| d 6| d 6| d 6| d
6| d 6} t d | | � } | rt d
r� d |
d <d j | � |
d <|
St d | d | d | d | | �r� d j | � |
d <d |
d | <|
St |
d <d j | � |
d <|
Sn d j | � |
d <|
S( u�
Ensure that the named extension is absent.
name
Extension name of the extension to remove
if_exists
Add if exist slug
restrict
Add restrict slug
cascade
Drop on cascade
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 u commentu maintenance_dbu runasu hostu useru portu passwordu postgres.is_installed_extensionu testu"