관리-도구
편집 파일: io.cpython-311.opt-1.pyc
� ΈQg� � � � d dl Z d dlZd dlZd dlZd dlZd dlZd dlmZ d dlm Z ej e� � Zd d�Z ej d� � � Zd� Zdd �ZdS )� N)� clcaptain)�ExternalProgramFailedTc �$ � t | d� � 5 }|� � � cddd� � S # 1 swxY w Y dS # t t f$ r> t j d| z t j d� � |s� t j d� � Y dS w xY w)z� Helper for read file, process errors and make backup before read :param: filename `str` name of file for read :param: exit_on_error `bool` use sys.exit on error or raise exception �rNzError: failed to read � ) �open� readlines�OSError�IOError�secureio�logging�SILENT_FLAG�sys�exit)�filename� exit_on_error�_files ��/builddir/build/BUILDROOT/cagefs-7.6.22-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcagefslib/io.py� read_filer s� � �� �(�C� � � %�E��?�?�$�$� %� %� %� %� %� %� %� %� %� %� %� %���� %� %� %� %� %� %�� �W�� � � ���1�H�<�h�>R�TU�V�V�V�� ����������� ���s- �A �3�A �7�A �7�A � AB�Bc � � t | � � S )N)r )�paths r �read_file_cachedr $ s � ��T�?�?�� c �z � t j | ||||t j �� � }t j |� � |d u S )N)�logger)r �create_dir_securer �closefd)r �perm�uid�gid�parent_path�fds r �make_userdirr# * s= � � � #�D�$��S�+�h�N^� _� _� _�B���R���� ��:�r Fc � � |s t j � |� � �s2 t j |� � nj# t $ r]}|j t j k rt � d|� d�� � nt � d|� �|�� � Y d }~nd }~ww xY w t j | |� � n�# t t f$ r�}d|� d| � dt |� � � dd � � � �}t � ||�� � |rt j ||d � � nt# |t$ j �� � Y d }~d S d }~ww xY wdS ) NzSymlink z does not existz Error: Unable to remove symlink )�exc_infoz Error: failed to create symlink z to z : �ErrnozErr codeT)�fileF)�osr �islink�unlinkr �errno�ENOENTr �info�errorr �symlinkr �str�replacer r �printr �stderr)� dest_path� link_name� write_log�force�silent�e�msgs r �switch_symlinkr; 1 s� � �� �B�G�N�N�9�-�-� � Y��I�i� � � � ��� Y� Y� Y��w�%�,�&�&����A�y�A�A�A�B�B�B�B����K� �K�K�VW��X�X�X���������� Y���� ���i��3�3�3�3���.�/� � � �w�Y�w�w�I�w�w�RU�VW�RX�RX�R`�R`�ah�jt�Ru�Ru�w�w�C��L�L��q�L�)�)�)�� ,�� ��f�d�3�3�3�3��c�� �+�+�+�+��4�4�4�4�4����� ���� �5s/ �9 � B �AB�B �$B: �:E�A<E � E)T)TTF)r+ � functoolsr r( r r �clcommonr �clcommon.utilsr � getLogger�__name__r r �cacher r# r; � r r �<module>rC s� �� ���� � � � � ���� � � � � � � � � ���� � � � � � � 0� 0� 0� 0� 0� 0� �� �8� $� $��� � � �"