????
Current Path : /opt/cloudlinux/venv/lib/python3.11/site-packages/clsummary/__pycache__/ |
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/clsummary/__pycache__/summary.cpython-311.pyc |
� xޘf�4 � �J � d dl mZ d dl mZ d dlZd dlZd dlmZ d dlZd dlZd dl Z d dl Z d dlZd dlZd dl Z d dlZd dlZd dlZd dlZd dlZd dlmZmZ d dlmZmZ d dlmZ d dlmZ d d lmZ d d lmZ d dl m!Z! d dl"m#Z# d dl$Z$d dl%Z&d dl'Z'd d l(m)Z) d dl*m+Z+ d dl,m-Z- d dl.m/Z/m0Z0m1Z1m2Z2m3Z3 d dl4m5Z5m6Z6 d dl7m8Z8m9Z9m:Z:m;Z;m<Z<m=Z=m>Z>m?Z?m@Z@ d dlAmBZBmCZCmDZD d dlEmFZF d dlGmHZH d dlImJZJ d dlKmLZLmMZMmNZN d dlOmPZPmQZQ d dlRmSZSmTZT d dlUmVZV d dlWmXZX ddlYmZZZ d dl[m\Z\m]Z]m^Z^m_Z_m`Z`maZambZbmcZc d dldmeZemfZfmgZgmhZhmiZimjZjmkZkmlZlmmZmmnZnmoZompZpmqZqmrZrmsZsmtZtmuZu d d lvmwZw d d!lxmyZymzZzm{Z{ d d"l|m}Z} d d#l~mZ� d d$l�m�Z�m�Z� d d%l�m�Z� d d&l�m�Z� d d'l�m�Z�m�Z�m�Z�m�Z�m�Z�m�Z� d d(l�m�Z� d d)l�m�Z� d d#l�mZ� d d*l�m�Z� n# e�$ r eoZ�eoZ�eoZ�eoZ�eoZ�eoZ�eoZ�dZ�dZ�dZ�Y nw xY w d d+l�m�Z� n# e�$ r d,� Z�Y nw xY wd-Z� e j� d.� � Z�d/Z�d0Z�d1Z�d2Z�d3Z�d4Z�d5Z�d6Z� G d7� d8e�� � Z�d9e�d:e�fd;�Z� G d<� d=e�� � Z�d>� Z�dS )?� )�absolute_import)�divisionN)�range)� lru_cache�partial)�Counter�defaultdict)�groupby�� iteritems)� attrgetter)� cpu_count)�getfqdn)�Path)�cpapi)�Feature)� MySQLGovernor)�is_cl_solo_edition�is_cl_shared_edition� CLEditions� is_ubuntu�is_secureboot_enabled)�is_panel_feature_supported�is_wp2_environment) �get_rhn_systemid_value�run_command�ExternalProgramFailed�is_testing_enabled_repo�is_litespeed_running�get_cl_version� get_virt_type�grep�is_nginx_running)� find_wp_paths�get_wp_cache_plugin� get_wp_paths_with_enabled_module)�ACCELERATE_WP_INSTALLED_FROM_CM)�client_activation_data)� SysCtlConf)�cagefs_statistics_config�db_governor_lib�clconfig_utils)�print_dictionary�replace_params)�LimitsDataStorage�DEFAULTS)�EMPTY_LIMITS)�LvpMap� )�parse_cloudlinux_summary_opts)�Dict�Optional�Callable�Union�List�Any�Tuple�AnyStr)�is_statistic_enabled�is_statistic_rpm_enabled� set_statistic_collection_enabled�$set_statistic_rpm_collection_enabled�$write_statistics_send_status_to_file� SummaryStatus�is_python_selector_installed�is_ruby_selector_installed�is_nodejs_selector_installed�is_php_selector_installed�dummy_none_function� get_packages_with_lve_extensions�is_sending_process_running�$get_statistics_send_status_from_file�get_client_data_from_jwt_token�get_cl_plus_sender_status�is_active_cloudlinux_license)�get_rpm_packages_info)�get_cpu_metrics�get_memory_metrics�NotSupported)�ALL_MODULES)�PKG_VERSION)�CONFIG_PATH�_read_config_file)�is_email_notification_enabled)�get_hidepid_typing_from_mounts)�get_versions_statistics�get_native_version_safe�get_php_selector_usage�iter_server_applications�get_default_php_version�get_mode_of_php_selector)�CloudlinuxSelectorLib)�get_default_version)�PKG_RELEASE)�list_flags_infoc � � t � � S �N)�list� � �H/opt/cloudlinux/venv/lib64/python3.11/site-packages/clsummary/summary.py�<lambda>rh � s � �d�f�f� rf z/var/log/cloudlinux-summary.logzcloudlinux-summary�unknown� installed� not_installed�not_initialized�not_selected�enabled�disabled�-42c �J � e Zd ZdZddddgdgddiddiddig d� Zd d�Zd d�Zd S )�StatisticsDictz> Special class to store all metrics before sending it rp ����g E�) �str�int�float�str_list�int_list�int_dict� float_dict�str_dict� rpm_stat_listTc � � | j | } |� � }n7# t $ r*}|rt � d||� � |}Y d}~nd}~ww xY w|S )a Method for catching any exceptions while calling passed function, logging them and return default result in case if exception is present or return formatted result in case if exception is absent :param log_exception: True - exception will been logged, False - exception won't been logged This flag must be used if param `func` is function, which processes intermediate value, which can equal to -42 (it means that exception was logged in previous moment) and doesn't call external functions or doesn't process another values. In other cases log_exception should be equal True, because in calling of external function or processing of another value can be raised exception, which should be logged. Example: functions `lambda: intermediate_value[0].property` or [len(value) for value intermediate_value.values()] should be used with log_exception equal False, because they only process intermediate value. But function: def some_function(intermediate_value): result = external_function() return len(intermediate_value), result should be used with log_exception equal True z%s. Exception: "%s"N)�DEFAULT_RESULTS� Exception� app_logger� exception)�self�func�type_of_result�log_message� log_exception�default_result�result�errs rg �run_safe_or_log_errorsz%StatisticsDict.run_safe_or_log_errors� s� � �. �-�n�=�� $��T�V�V�F�F��� $� $� $�� ��$�$�)���� � � $�F�F�F�F�F�F����� $���� � s � � A� A � Ac �B � | � ||||�� � }|| |<