Your IP : 3.144.242.235


Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/clveconfig/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/clveconfig/__pycache__/ve_lock.cpython-311.pyc

�

B�cg����ddlZddlZddlmZdZej�ed��Zdada	Gd�de
��Zdd�Zd	�Z
edd
���ZdS)�N)�contextmanagerz/etc/containerz.ve.cfg.lockFc��eZdZdS)�LockFailedExceptionN)�__name__�
__module__�__qualname__���I/opt/cloudlinux/venv/lib64/python3.11/site-packages/clveconfig/ve_lock.pyrrs�������Dr
rc��t�dS|rda	ttdd���at	jt���tj��n"#t$r}td��|�d}~wwxYwt�
dd��t���t�ttj������t���dS)NFTza+zutf-8)�encodingz$IO error happened while getting lockr)�LOCK_FD�
LOCK_WRITE�open�	LOCK_FILE�fcntl�flock�fileno�LOCK_EX�IOErrorr�seek�truncate�write�str�os�getpid�flush)r�es  r�setup_global_lockrs������u����
�Q��y�$��9�9�9��
��G�N�N�$�$�e�m�4�4�4�4���Q�Q�Q�!�"H�I�I�q�P�����Q�����L�L��A�����������M�M�#�b�i�k�k�"�"�#�#�#��M�M�O�O�O��4s�A
A�
A<�'A7�7A<c�`�trdSt�t���dadSdS)NFT)rr�closer	r
r�release_lockr".s6�����u����
�
�������t��r
c#�LK�t|��dV�t��dS)zQ
    Usage:
    with acquire_lock():
       ... do something with ve.cfg ...
    N)rr")rs r�acquire_lockr$;s,�����e����	�E�E�E��N�N�N�N�Nr
)F)rr�
contextlibr�
CONFIG_DIR�path�joinrrr�	Exceptionrrr"r$r	r
r�<module>r*s���
����	�	�	�	�%�%�%�%�%�%�
�
��G�L�L��^�4�4�	���
�
�	�	�	�	�	�)�	�	�	�����*
�
�
���������r

?>