관리-도구
편집 파일: dom_collector.cpython-311.pyc
� |�Cg[ � �t � d dl Z d dlZd dlZd dlZd dlZd dlmZ d dlmZ d dl m Z mZmZ G d� d� � Z dS )� N)�ClPwd)�Feature)�is_panel_feature_supported� list_users�userdomainsc �l � e Zd ZdZd� Zed� � � Zd� Zd� Zd� Z ed� � � Z ed� � � Zd S ) �DomainCollectorzR Class for print panel users domain docroots. See LU-1751 for details c �� � t t j � d� � � � | _ | � � � | _ t � � | _ d S )N�DOM_COLL_RUNNING_IN_LVE) �bool�os�environ�get� is_not_in_lve�is_not_limited�is_not_limited_processr �_clpwd)�selfs �U/opt/cloudlinux/venv/lib64/python3.11/site-packages/cl_dom_collector/dom_collector.py�__init__zDomainCollector.__init__ sG � �!%�b�j�n�n�5N�&O�&O�!P�!P�P���&*�&9�&9�&;�&;��#��g�g����� c � � t t j � d� � � � } t t j � d� � � � }| o| S )Nr �DOM_COLL_RUNNING_IN_NICE)r r r r )�is_limited_by_lve�is_limited_by_nices r r zDomainCollector.is_not_limited sN � � �����0I�!J�!J�K�K��!�"�*�.�.�1K�"L�"L�M�M��$�$�?�-?�)?�?r c � � t t � � � � � � � }g }|D ]M} | j � |� � d }|� |� � �9# t j $ r Y �Jw xY w|S )zL Get panel user names list :return: user names list r )�listr �keysr � get_names�appendr �NoSuchUserException)r �panel_uids_list�panel_users_list�uid�names r �_get_panel_user_names_listz*DomainCollector._get_panel_user_names_list# s� � � �z�|�|�0�0�2�2�3�3����"� � �C� ��{�,�,�S�1�1�!�4�� �'�'��-�-�-�-���,� � � ��� �����s �5A+�+A=�<A=c � � | � � � }|D ]v} t |� � D ]S\ }}t j |� d� � � � � d� � }t |� d|� �� � �T�g# t $ r Y �sw xY wdS )z� Method prints pair `domain,doc_root` for an each user on a server domain is encoded in punycode if it's needed doc_root is always encoded in base64 zutf-8�,N)r&