관리-도구
편집 파일: clwpos_get.cpython-311.pyc
� b��f� � �� � d Z ddlZddlZddlZddlZddlZddlmZ ddlm Z ddl mZ ddlm Z ddlmZ n# e$ r d� ZY nw xY wd d lmZ d dlmZ ddlmZ ej d � � Z G d� d� � ZdS )zG This module contains a wrapper around `clwpos-user get` local utility � N)�Optional)�Feature)�is_panel_feature_supported)�CloudlinuxSummary)�is_wpos_visiblec � � d S )N� ��usernames �N/opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/adviser/clwpos_get.py�<lambda>r s � �t� � � )� get_client)�NginxUserCache)�get_plugin_status�clwpos_utilc � � e Zd ZdZdededdfd�Zededefd�� � Ze de e fd�� � Ze defd �� � Zded ede e fd�Zed� � � Zd � Zded ede fd�Zedefd�� � Zede ddfd�� � ZdS )�ClWposGetterz/usr/bin/clwpos-userr �domain�returnNc �N � | � |� � rt � d� � dS | � ||� � }t � dt |� � � � |r| � |� � dS t � d||� � dS )z8Construct and POST metadata to Smart Advice microservicez)ea-nginx detected, skipping metadata sendNzGot WPOS: %sz4Metadata for user %s with domain %s will not be sent)�nginx_cache_for_user�logger�info�construct_metadata�debug�str�send�error)�selfr r � json_datas r � post_metadatazClWposGetter.post_metadata% s� � ��$�$�X�.�.� ��K�K�C�D�D�D��F��+�+�H�f�=�=� ����^�S��^�^�4�4�4�� c��I�I�i� � � � � ��L�L�O�QY�[a�b�b�b�b�br c �* � t | � � j S )z9 Check nginx cache status for given user )r � is_enabledr s r r z!ClWposGetter.nginx_cache_for_user1 s � � �h�'�'�2�2r c �<