%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/mysql_database.pyc

�
���^c@@swdZddlmZmZmZddlZddlZeje�Z	d�Z
d�Zddd�Z
d�ZdS(uy
Management of MySQL databases (schemas)
=======================================

:depends:   - MySQLdb Python module
:configuration: See :py:mod:`salt.modules.mysql` for setup instructions.

The mysql_database module is used to create and manage MySQL databases.
Databases can be set as either absent or present.

.. code-block:: yaml

    frank:
      mysql_database.present
i(tabsolute_importtprint_functiontunicode_literalsNcC@s
dtkS(u@
    Only load if the mysql module is available in __salt__
    umysql.db_exists(t__salt__(((s>/usr/lib/python2.7/site-packages/salt/states/mysql_database.pyt__virtual__scC@s!tjtdjjjdd�S(up
    Look in module context for a MySQL error. Eventually we should make a less
    ugly way of doing this.
    u	test.pingumysql.errorN(tsystmodulesRt
__module__t__context__tpoptNone(((s>/usr/lib/python2.7/site-packages/salt/states/mysql_database.pyt_get_mysql_error!sc		K@s�i|d6id6td6dj|�d6}td||�}|r�t}|r�||jd�kr�tjd||jd��t}n|r�||jd	�kr�tjd
||jd	��t}n|r�td|d|d
||�ntd||�}|jd	d�|jd	d�krh|djii|jd	d�d6|jd	d�d6d	6�n|jdd�|jdd�kr�|djii|jdd�d6|jdd�d6d6�n|St	�}|dk	r�||d<t|d<|St
dr)d|d<dj|�|d<|Std|d|d
||�rldj|�|d<d|d|<nNdj|�|d<t	�}|dk	r�|dcdj|�7<nt|d<|S(u�
    Ensure that the named database is present with the specified properties

    name
        The name of the database to manage
    unameuchangesuresultuDatabase {0} is already presentucommentumysql.db_getu
character_setu#character set differes from %s : %sucollateu collate set differs from %s : %sumysql.alter_dbt
character_settcollateubeforeunowutestu3Database {0} is not present and needs to be createdumysql.db_createu!The database {0} has been createduPresentuFailed to create database {0}u ({0})N(tTruetformatRtFalsetgettlogtdebugR
tupdateRt__opts__(	tnameRR
tconnection_argstrettexistingtaltertcurrentterr((s>/usr/lib/python2.7/site-packages/salt/states/mysql_database.pytpresent+sd
				
$$	




		
cK@si|d6id6td6dd6}td||�r�tdr`d|d<dj|�|d<|Std	||�r�d
j|�|d<d|d|<|St�}|dk	rdj||�|d<t|d<|Sn-t�}|dk	r||d<t|d<|Sd
j|�|d<|S(ug
    Ensure that the named database is absent

    name
        The name of the database to remove
    unameuchangesuresultuucommentumysql.db_existsutestu/Database {0} is present and needs to be removedumysql.db_removeuDatabase {0} has been removeduAbsentu#Unable to remove database {0} ({1})u4Database {0} is not present, so it cannot be removedN(RRRR
RRR(RRRR((s>/usr/lib/python2.7/site-packages/salt/states/mysql_database.pytabsentls6



	
	


(t__doc__t
__future__RRRRtloggingt	getLoggert__name__RRRR
RR(((s>/usr/lib/python2.7/site-packages/salt/states/mysql_database.pyt<module>s		
A

Zerion Mini Shell 1.0