관리-도구
편집 파일: cloudlinux_statsnotifier.cpython-311.pyc
� �Cg^ � �* � d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlmZm Z d dl mZ d dlm Z d dlmZ d dlmZ d dlmZ d dlmZ d d lmZ d ej dej deeef fd �Zdede fd�Zdedefd�Zd� Z dededdfd�Z!dede fd�Z"d� Z#dS )� N)�Tuple�Dict)�run_command)�config)�USER_NOTIFICATIONS_OFF_MARKER)� setup_logging)�user_should_be_notified)�get_stats_notifier_parameters)�dateutil�args�log�returnc � � | j sdS t j � � }|dk r | j sdS | j �t | j | j � � }nt | j � � }nR# t $ rE}d|� �t j � � d�}|� t |� � � � Y d}~nd}~ww xY wt j |� � }|dfS )zA Generic method to analyze options and call needed funcs )z Only JSON mode supported for now���r )z'Please, specify user id via --id optionr Nzerror: ��result� timestamp) �json�os�getuid�id� notifyUser�manage_user_notifications�get_notifications_settings� Exceptionr �gm_datetime_to_unixtimestamp�error�str�dumps)r r �current_userr �e�json_strs ��/builddir/build/BUILDROOT/lve-stats-4.2.10-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/lib/cloudlinux_statsnotifier.py�executer$ s� � � �9� 6�5�5��9�;�;�L��q������<�<� ��?�&�.�t�w���H�H�F�F�/���8�8�F���� � � �#��m�m�!�>�@�@� � �� � � �#�a�&�&����������������� �z�&�!�!�H��Q�;�s �6A$ �$ B3�.;B.�.B3�user_idc �� � dt j � � d�}t j � � }|dk s|n| }t j |� � j }t |� � |d<