File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/modjk.cpython-310.pyc
o
�N�gY1 � @ s� d Z ddlZddlZdd� Zdd� Zd0dd �Zd0d
d�Zd0dd
�Zd0dd�Z d0dd�Z
d0dd�Zd0dd�Zd0dd�Z
d0dd�Zd0dd�Zd0dd�Zd0dd�Zd0d d!�Zd0d"d#�Zd0d$d%�Zd0d&d'�Zd0d(d)�Zd0d*d+�Zd0d,d-�Zd0d.d/�ZdS )1a�
Control Modjk via the Apache Tomcat "Status" worker
(http://tomcat.apache.org/connectors-doc/reference/status.html)
Below is an example of the configuration needed for this module. This
configuration data can be placed either in :ref:`grains
<targeting-grains>` or :ref:`pillar <salt-pillars>`.
If using grains, this can be accomplished :ref:`statically
<static-custom-grains>` or via a :ref:`grain module <writing-grains>`.
If using pillar, the yaml configuration can be placed directly into a pillar
SLS file, making this both the easier and more dynamic method of configuring
this module.
.. code-block:: yaml
modjk:
default:
url: http://localhost/jkstatus
user: modjk
pass: secret
realm: authentication realm for digest passwords
timeout: 5
otherVhost:
url: http://otherVhost/jkstatus
user: modjk
pass: secret2
realm: authentication realm2 for digest passwords
timeout: 600
� Nc C s dS )z
Always load
T� r r r �F/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/modjk.py�__virtual__% s r c C sF t j�� }|j|| ||d� t j�� }|j|| ||d� t j�||�S )z+
returns a authentication handler.
)�realmZuri�user�passwd)�urllib�requestZHTTPBasicAuthHandlerZadd_passwordZHTTPDigestAuthHandlerZbuild_opener)�urlr r r Zbasic�digestr r r �_auth, s
r �defaultc C s( i }t d d|� d�d�}t d d|� d�d�}t d d|� d�d�}t d d|� d�d�}t d d|� d�d�}|sBtd |� ���|rT|rTt||||d
�}tj�|� |dtj�| �� �7 }tjj||d�� � �
� D ]&} | �d
d�}
|
d |v r�||
d d|
d � �7 <