|
Server : LiteSpeed System : Linux barito.iixcp.rumahweb.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64 User : elvh3918 ( 1528) PHP Version : 8.2.31 Disable Function : mail Directory : /lib/python3.9/site-packages/ansible/module_utils/facts/__pycache__/ |
a
�)g� � @ sR d dl mZmZmZ eZd dlZd dlmZ dZ
dZG dd� de�Z
d dd�ZdS )
� )�absolute_import�division�print_functionN�
c @ s e Zd ZdS )�TimeoutErrorN)�__name__�
__module__�__qualname__� r
r
�F/usr/lib/python3.9/site-packages/ansible/module_utils/facts/timeout.pyr s r �
Timer expiredc s( � fdd�}t � �r$� }d� ||�S |S )z�
Timeout decorator to expire after a set number of seconds. This raises an
ansible.module_utils.facts.TimeoutError if the timeout is hit before the
function completes.
c s � �fdd�}|S )Nc s� �}|d u rt � �d�pt}tjdd�}|�� | |�}|�� zDz|�|�W W |�� S tj yv t d| ��Y n0 W |�� n
|�� 0 d S )N�GATHER_TIMEOUT� )Z processeszTimer expired after %s seconds)
�globals�get�DEFAULT_GATHER_TIMEOUT�mpZ
ThreadPoolZapply_async�closeZ terminate�multiprocessingr )�args�kwargsZ
timeout_value�pool�res)�func�secondsr
r �wrapper( s �z+timeout.<locals>.decorator.<locals>.wrapperr
)r r �r )r r � decorator'