관리-도구
편집 파일: ve_config_reader.cpython-311.pyc
� |�Cg� � �� � d dl mZ d dlmZmZmZmZmZ d dlm Z d dl mZ ddlm Z edg d�� � Z ed g d�� � Z ed d d d d d d d � � ZdZ G d� d � � Zd S )� )� namedtuple)�Tuple�Optional�Type�List�Iterator)�etree)�ClPwd� )�get_xml_config_etree�Limits��cpu�ncpu�io�vmem�pmem�nproc�ep�iops�InheritedLimitsN�rootc � � e Zd ZdZdd�Zd� Zd� Zeefd�� � Z e d� � � Zd� Ze fd �Zd � Zd� Zd� Zd � Zd� Zd� Zd� ZdS )�XmlConfigReadera5 This class parses our xml into user-friendly primitive structures (dicts, tuples, namedtuples) This class may do: - data conversion (cpu & ncpu in config -> speed) - validation This class should NOT: - take care of user/package/reseller existence - write anything to xml Nc � � t � � | _ |�t � � | _ n|| _ t | � � � � � | _ t | � � � � � | _ t | � � � � � | _ t | � � � � � | _ d S �N) r �clpwdr �_xml_config�dict� _users_limits� _users_map�_packages_limits� _packages_map�_resellers_limits�_resellers_limits_map�_resellers_defaults�_resellers_defaults_map)�self�_xml_config_etrees �R/opt/cloudlinux/venv/lib64/python3.11/site-packages/clveconfig/ve_config_reader.py�__init__zXmlConfigReader.__init__* s� � ��W�W�� ��$�3�5�5�D���0�D���t�1�1�3�3�4�4���!�$�"7�"7�"9�"9�:�:���%)�$�*@�*@�*B�*B�%C�%C��"�'+�D�,D�,D�,F�,F�'G�'G��$�$�$� c �Z � t | j � d� � j � � S )N�version)�intr �find�text�r( s r* r. zXmlConfigReader.version8 s$ � ��4�#�(�(��3�3�8�9�9�9r, c �\ � | � | j � d� � � � S )N�defaults)�_parse_limits_sectionr r0 r2 s r* r4 zXmlConfigReader.defaults<