????
Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/__pycache__/utils.cpython-311.pyc |
� K�fqs � �� � d dl mZmZmZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dlZd dl Z d dlZd dlmZmZ d dlmZ d dlmZmZmZmZmZmZ d dlZd dlZd dlmZ d dlm Z d dl!m"Z"m#Z#m$Z$m%Z% d Z&d Z'dZ(d� Z)dMd �Z*d� Z+d� Z,d� Z-d� Z. dNd�Z/d� Z0dee1 fd�Z2d� Z3de4fd�Z5dee1 fd�Z6 ed�� � dee1 fd�� � Z7de8fd�Z9de1de4fd �Z:de4fd!�Z;de4fd"�Z<d#� Z=d$� Z>d%� Z?d&� Z@d'� ZAd(� ZBd)� ZCd*e1de4fd+�ZDd,e8de4fd-�ZEd.edee4 fd/�ZFde8fd0�ZGd1e1dee4e4f fd2�ZHd1e1dee4e4f fd3�ZId1e1dee4e4f fd4�ZJd5e1d6e4de4fd7�ZKd8eej ejL f de1fd9�ZM dMd:e1d;e1d<e1d=e8dee8e1f f d>�ZNde1fd?�ZOde4fd@�ZPdAe1dee8 fdB�ZQdAe1fdC�ZRdAe1fdD�ZSdE� ZTdFe1de1fdG�ZUde4fdH�ZVdIe1de1fdJ�ZWdKe1de1fdL�ZXdS )O� )�absolute_import�division�print_functionN)�ConfigParser�Error)� lru_cache)�Any�AnyStr�Dict�Optional�Tuple�Union)�etree)� is_ubuntu)�ExternalProgramFailed� check_command�exec_utility�run_commandz/etc/sysconfig/rhn/systemid)�Mon�Tue�Wed�Thu�Fri�Sat�Sunz /opt/cloudlinux/litespeed_statusc � � d}t j � |� � r& t j |� � }n# t $ r Y nw xY w| |k r= t j |� � n# t $ r Y nw xY wt j | |� � dS dS )a Create symlink link_path -> link_value if it does not exist or points to different location :param link_value: path that symlink should point to (symlink value) :type link_value: str :param link_path: path where to create symlink :type link_path: str N)�os�path�islink�readlink�OSError�unlink�symlink)� link_value� link_path�link_tos ��/builddir/build/BUILDROOT/alt-python27-cllib-3.4.8-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/utils.py�create_symlinkr( 2 s� � � �G� �w�~�~�i� � � � ��k�)�,�,�G�G��� � � ��D� �����W��� ��I�i� � � � ��� � � ��D� ���� � �:�y�)�)�)�)�)� �s! �8 � A�A�A$ �$ A1�0A1c �� � g }t j � | � � r>t | d|�� � 5 }|� � � }ddd� � n# 1 swxY w Y |S )a Read file and return file's lines errors param may be passed to define how handle unicode errors, errors=None is default value of open() :param path: path to file :param unicode_errors_handle: how to handle unicode errors :return: list of file's lines �r��errorsN)r r �isfile�open� readlines)r �unicode_errors_handle�content�fs r'