%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/webutil.pyo

�
���^c@@skdZddlmZmZmZddlZdZd�Zddde
de
d�Zddd�ZdS(	u+
Support for htpasswd module. Requires the apache2-utils package for Debian-based distros.

.. versionadded:: 2014.7.0

.. code-block:: yaml

    username:
      webutil.user_exists:
        - password: secr3t
        - htpasswd_file: /etc/nginx/htpasswd
        - options: d
        - force: true

i(tabsolute_importtprint_functiontunicode_literalsNuwebutilcC@stjjjd�rtStS(u#
    depends on webutil module
    uhtpasswd(tsalttutilstpathtwhicht__virtualname__tFalse(((s7/usr/lib/python2.7/site-packages/salt/states/webutil.pyt__virtual__sucC@s�i|d6id6dd6dd6}td|dj|��dd	k}t}	|r�|r�|r�td
|||d|d|�}	n|s�|	s�|rTtd
r�d|d<dj|�|d<it|6|d<|Std|||d|d|�}
|
dd	kr5t|d<|
d|d<it|6|d<|St|d<|
d|d<|Sntd
ru|drud|d<n
t|d<d|d<|S(u
    Make sure the user is inside the specified htpasswd file

    name
        User name

    password
        User password

    htpasswd_file
        Path to the htpasswd file

    options
        See :mod:`salt.modules.htpasswd.useradd`

    force
        Touch the file even if user already created

    runas
        The system user to run htpasswd command with

    update
        Update an existing user's password if it's different from what's in
        the htpasswd file (unlike force, which updates regardless)

    unameuchangesuucommenturesultu	file.grepu^{0}:uretcodeiuwebutil.verifytoptstrunasutestu.User '{0}' is set to be added to htpasswd fileuwebutil.useraddustderruUser already knownN(tNonet__salt__tformatRt__opts__tTrue(tnametpasswordt
htpasswd_filetoptionstforceRtupdatetrettexiststpassword_changedtuseradd_ret((s7/usr/lib/python2.7/site-packages/salt/states/webutil.pytuser_exists$s@




	




cC@si|d6id6dd6dd6}td|dj|��dd	k}|s|td
red|d<n
t|d<d|d<n�td
r�d|d<dj|�|d<it|6|d<n_td
||d|dt�}|dd	k|d<|d|d<|drit|6|d<n|S(u�
    Make sure the user is not in the specified htpasswd file

    name
        User name

    htpasswd_file
        Path to the htpasswd file

    runas
        The system user to run htpasswd command with

    unameuchangesuucommenturesultu	file.grepu^{0}:uretcodeiutestuUser already not in fileu2User '{0}' is set to be removed from htpasswd fileuwebutil.userdelRtall_resultsustderrN(RR
RRR(RRRRRtuserdel_ret((s7/usr/lib/python2.7/site-packages/salt/states/webutil.pytuser_absentks,








(
t__doc__t
__future__RRRtsalt.utils.pathRRR	RRRR(((s7/usr/lib/python2.7/site-packages/salt/states/webutil.pyt<module>s		F

Zerion Mini Shell 1.0