관리-도구
편집 파일: ve_config.cpython-311.pyc
� |�Cg � � � d dl Z d dlmZ d dlmZ d dlmZ ddlm Z m Z e j � e d� � Z e dz Zd a G d � de� � Zdd �Zd� Zd� ZdS )� N)�minidom)� ExpatError)�etree� )� CONFIG_DIR�acquire_lockzve.cfgz.tmp�NNc � � � e Zd Zd� fd� Z� xZS )�BadVeConfigException�Nothingc �P �� t � � � d|� �� � d S )Nz5Unable to parse /etc/container/ve.cfg file, message: )�super�__init__)�self�message� __class__s ��K/opt/cloudlinux/venv/lib64/python3.11/site-packages/clveconfig/ve_config.pyr zBadVeConfigException.__init__ s4 �� � �����M�G�M�M� � � � � � )r )�__name__� __module__�__qualname__r � __classcell__)r s @r r r s= �� � � � � � � � � � � � � � � r r Tc �d � t dk r | rt S t � � 5 t j t � � }|� d� � d }n5# t t t t f$ r}t d� � |�d}~ww xY w| r||fa ||fcddd� � S # 1 swxY w Y dS )z� Load xml config from ve.cfg 1. setup lock on file 2. read info 3. remove lock :type use_cache: bool :rtype: tuple[xml.Document, xml.Element] :raises: BadVeConfigException, LockFailedException r � lveconfigr zbad ve.cfg fileN)�PARSED_XML_CACHEr �xml�parse�VE_CFG_PATH�getElementsByTagName�OSError�IOErrorr � IndexErrorr )� use_cache�_ve_cfg� _ve_lveconfig�es r �get_xml_configr'