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

�
���^c@@s�dZddlmZmZmZddlZddlmZeje	�Z
d�Zddddddddddddddddd�Z
ddddddd�ZdS(u�
Management of PostgreSQL groups (roles)
=======================================

The postgres_group module is used to create and manage Postgres groups.

.. code-block:: yaml

    frank:
      postgres_group.present
i(tabsolute_importtunicode_literalstprint_functionN(tpostgrescC@sdtkrtdfStS(u5
    Only load if the postgres module is present
    upostgres.group_createuFUnable to load postgres module.  Make sure `postgres.bins_dir` is set.(t__salt__tFalsetTrue(((s>/usr/lib/python2.7/site-packages/salt/states/postgres_group.pyt__virtual__s
c C@s1i|d6id6td6dj|�d6}|tk	rCtj}ntj||d|�}i|d6|d6|d	6|d
6|d6|
d6}d
}td|d|	|�}|d)k	r�d}nd)}i}|dkr|d)k	r|d|kr||d<n|d)k	r*|d|kr*||d<n|d)k	rS|d|krS||d<n|d)k	r||d|kr|||d<n|d)k	r�|d|kr�||d<n|d)k	r�|d|kr�||d<n|d)k	r|	s�|d|krt|d<qn|d
ks|dkr�|r�tdrc|r?||d|<nd)|d<dj||�|d<|Stdj|�d|d|d |d|d!|d"|d#|d$|d%|d&|
|�
}nd)}|r�d'j||�|d<|r-||d|<q-n6|d)k	r#d(j|�|d<t|d<n
t|d<|S(*u�
    Ensure that the named group is present with the specified privileges
    Please note that the user/group notion in postgresql is just abstract, we
    have roles, where users can be seen as roles with the ``LOGIN`` privilege
    and groups the others.

    name
        The name of the group to manage

    createdb
        Is the group allowed to create databases?

    createroles
        Is the group allowed to create other roles/users

    encrypted
        Should the password be encrypted in the system catalog?

    login
        Should the group have login perm

    inherit
        Should the group inherit permissions

    superuser
        Should the new group be a "superuser"

    replication
        Should the new group be allowed to initiate streaming replication

    password
        The group's password
        It can be either a plain string or a md5 postgresql hashed password::

            'md5{MD5OF({password}{role}}'

        If encrypted is ``None`` or ``True``, the password will be automatically
        encrypted to the previous format if it is not already done.

    refresh_password
        Password refresh flag

        Boolean attribute to specify whether to password comparison check
        should be performed.

        If refresh_password is ``True``, the password will be automatically
        updated without extra password change check.

        This behaviour makes it possible to execute in environments without
        superuser access available, e.g. Amazon RDS for PostgreSQL

    groups
        A string of comma separated groups the group should be in

    user
        System user all operations should be performed on behalf of

        .. versionadded:: 0.17.0

    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
    unameuchangesuresultuGroup {0} is already presentucommentt	encryptedumaintenance_dburunasuhostuuseruportupassworducreateupostgres.role_gettreturn_passworduupdateucan create databasesucreatedbuinherits privilegesuinheritu	can loginuloginucan create rolesucreaterolesureplicationu	superuserutestuGroup {0} is set to be {1}dupostgres.group_{0}t	groupnametcreatedbtcreaterolestlogintinheritt	superusertreplicationtrolepasswordtgroupsuThe group {0} has been {1}duFailed to create group {0}N(	RtformatRRt_DEFAULT_PASSWORDS_ENCRYPTIONt_maybe_encrypt_passwordRtNonet__opts__(tnameRRRRRR
Rtpasswordtrefresh_passwordRtusertmaintenance_dbtdb_passwordtdb_hosttdb_porttdb_usertrettdb_argstmodet
group_attrtcrettupdate((s>/usr/lib/python2.7/site-packages/salt/states/postgres_group.pytpresent$s�X
		
	





"



c	C@s�i|d6id6td6dd6}i|d6|d6|d6|d	6|d
6|d6}td||�r�td
r�d|d<dj|�|d<|Std||�r�dj|�|d<d|d|<|Sndj|�|d<|S(u�
    Ensure that the named group is absent

    name
        The groupname of the group to remove

    user
        System user all operations should be performed on behalf of

        .. versionadded:: 0.17.0

    db_user
        database username if different from config or defaul

    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
    unameuchangesuresultuucommentumaintenance_dburunasuhostuuseruportupasswordupostgres.user_existsutestuGroup {0} is set to be removedupostgres.group_removeuGroup {0} has been removeduAbsentu1Group {0} is not present, so it cannot be removedN(RRRRR(	RRRRRRR R!R"((s>/usr/lib/python2.7/site-packages/salt/states/postgres_group.pytabsent�s.





(t__doc__t
__future__RRRtloggingtsalt.modulesRt	getLoggert__name__tlogRRR'R((((s>/usr/lib/python2.7/site-packages/salt/states/postgres_group.pyt<module>s6	
�

Zerion Mini Shell 1.0