????
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.opt-1.pyc |
� �j�e�p � � � d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl Z d dl Z d dlZd dlZd dl Z d dlmZ d dlmZmZ d dlmZmZmZmZmZmZ d dlZd dlmZ d dlZd d lmZ d d l m!Z!m"Z"m#Z#m$Z$ dZ%dZ&d Z'd� Z(dKd�Z)d� Z*d� Z+d� Z,d� Z- dLd�Z.d� Z/dee0 fd�Z1d� Z2de3fd�Z4dee0 fd�Z5 ed�� � dee0 fd�� � Z6de7fd �Z8d!e0de3fd"�Z9de3fd#�Z:de3fd$�Z;d%� Z<d&� Z=d'� Z>d(� Z?d)� Z@d*� ZAd+� ZBd,e0de3fd-�ZCd.e7de3fd/�ZDd0edee3 fd1�ZEde7fd2�ZFd3e0dee3e3f fd4�ZGd3e0dee3e3f fd5�ZHd3e0dee3e3f fd6�ZId7e0d8e3de3fd9�ZJd:ee j e jK f de0fd;�ZL dKd<e0d=e0d>e0d?e7dee7e0f f d@�ZMde0fdA�ZNde3fdB�ZOdCe0dee7 fdD�ZPdCe0fdE�ZQdCe0fdF�ZRdG� ZSdHe0de0fdI�ZTde3fdJ�ZUdS )M� )�print_function)�absolute_import)�divisionN)� lru_cache)�ConfigParser�Error)�Dict�Any�AnyStr�Optional�Tuple�Union)�etree)� is_ubuntu)� check_command�run_command�exec_utility�ExternalProgramFailedz/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.3.15-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'