%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_user.pyc

�
���^c@@swdZddlmZmZmZddlZddlZd�Zd�Z	dddeedd�Zdd�Z
dS(	u.
Management of MySQL users
=========================

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

.. code-block:: yaml

    frank:
      mysql_user.present:
        - host: localhost
        - password: bobcat


.. versionadded:: 0.16.2
    Authentication overrides have been added.

The MySQL authentication information specified in the minion config file can be
overridden in states using the following arguments: ``connection_host``,
``connection_port``, ``connection_user``, ``connection_pass``,
``connection_db``, ``connection_unix_socket``, ``connection_default_file`` and
``connection_charset``.

.. code-block:: yaml

    frank:
      mysql_user.present:
        - host: localhost
        - password: "bob@cat"
        - connection_user: someuser
        - connection_pass: somepass
        - connection_charset: utf8
        - saltenv:
          - LC_ALL: "en_US.utf8"


This state is not able to grant permissions for the user. See
:py:mod:`salt.states.mysql_grants` for further instructions.

i(tabsolute_importtprint_functiontunicode_literalsNcC@s
dtkS(u6
    Only load if the mysql module is in __salt__
    umysql.user_create(t__salt__(((s:/usr/lib/python2.7/site-packages/salt/states/mysql_user.pyt__virtual__4scC@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_user.pyt_get_mysql_error;su	localhostcK@s^i|d6id6td6dj||�d6}t||f�}	|	r�tjjj|�std|d<t|d<|Std||dtd	|d
||�r�|dcd7<|St	�}
|
d k	ri|
|d<t|d<|Sn�td||||d	|d
||�r<|dcd7<|r8|r8|dcd
7<n|St	�}
|
d k	ri|
|d<t|d<|Std||d	||�r�tdrdj||�|d<d |d<|	r�|dcd7<tjjj|�s
|dcd7<t|d<q
n|dcd7<|Std|||||||�rfdj|||	rHdnd�|d<d|d|<qZdj|	rxdnd||�|d<t	�}
|
d k	r�|dcdj|
�7<n|	r�tjjj|�r�|dcd7<nt|d<nbt	�}
|
d k	r%|
|d<t|d<|Stdr�dj||�|d<d |d<|	r�|dcd7<tjjj|�s�|dcd7<t|d<q�n|Std|||||d	|d
||�r	dj||�|d<|	r�|dcd7<nd|d|<nQdj||�|d<t	�}
|
d k	rP|dcdj|
�7<nt|d<|S(!uT
    Ensure that the named user is present with the specified properties. A
    passwordless user can be configured by omitting ``password`` and
    ``password_hash``, and setting ``allow_passwordless`` to ``True``.

    name
        The name of the user to manage

    host
        Host for which this user/password combo applies

    password
        The password to use for this user. Will take precedence over the
        ``password_hash`` option if both are specified.

    password_hash
        The password in hashed form. Be sure to quote the password because YAML
        doesn't like the ``*``. A password hash can be obtained from the mysql
        command-line client like so::

            mysql> SELECT PASSWORD('mypass');
            +-------------------------------------------+
            | PASSWORD('mypass')                        |
            +-------------------------------------------+
            | *6C8989366EAF75BB670AD8EA7A7FC1176A95CEF4 |
            +-------------------------------------------+
            1 row in set (0.00 sec)

    allow_passwordless
        If ``True``, then ``password`` and ``password_hash`` can be omitted to
        permit a passwordless login.

        .. versionadded:: 0.16.2

    unix_socket
        If ``True`` and allow_passwordless is ``True``, the unix_socket auth
        plugin will be used.
    unameuchangesuresultuUser {0}@{1} is already presentucommentuUEither password or password_hash must be specified, unless allow_passwordless is Trueumysql.user_existstpasswordlesstunix_sockettpassword_columnu with passwordless loginu with the desired passwordu hashutestu'Password for user {0}@{1} is set to be uclearedu , but allow_passwordless != Trueuchangedumysql.user_chpassu&Password for user {0}@{1} has been {2}uUpdatedu'Failed to {0} password for user {1}@{2}uclearuchangeu ({0})uE. Note: allow_passwordless must be True to permit passwordless login.uUser {0}@{1} is set to be addedumysql.user_createuThe user {0}@{1} has been addeduPresentuFailed to create user {0}@{1}N(tTruetformattanytsalttutilstdatatis_truetFalseRRR
t__opts__(tnamethosttpasswordt
password_hashtallow_passwordlessR
Rtconnection_argstretRterr((s:/usr/lib/python2.7/site-packages/salt/states/mysql_user.pytpresentEs�.


		

	
	




		
	




		
cK@si|d6id6td6dd6}td|||�r�tdrfd
|d<dj||�|d<|Std	|||�r�d
j||�|d<d|d|<|St�}|d
k	r||d<t|d<|Sn-t�}|d
k	r||d<t|d<|Sdj||�|d<|S(u_
    Ensure that the named user is absent

    name
        The name of the user to remove
    unameuchangesuresultuucommentumysql.user_existsutestu!User {0}@{1} is set to be removedumysql.user_removeuUser {0}@{1} has been removeduAbsentu4User {0}@{1} is not present, so it cannot be removedN(RRRR
RRR(RRRRR((s:/usr/lib/python2.7/site-packages/salt/states/mysql_user.pytabsent�s8	




	

	

(t__doc__t
__future__RRRRtsalt.utils.dataRRRR
RR R!(((s:/usr/lib/python2.7/site-packages/salt/states/mysql_user.pyt<module>*s		�

Zerion Mini Shell 1.0