Advanced Web Server Manager
Complete File Manager & Terminal - Standalone Version
By Sid Gifari | Gifari Industries
Current path:
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
ssa
/
modules
/
__pycache__
✏️
Editing: decision_maker.cpython-311.pyc
� �Mj�- � �8 � d Z dZddlZddlZddlZddlZddlmZ ddlZ ddl mZ ddlm Z ddlmZmZ d d lmZ d dlmZ d dlmZ d d lmZmZ dZ G d� de � � Zedk r7 e� � ej dej �� � e� � Z e� � dS dS )z* This module contains DecisionMaker class zssa.modules� N)�isfile)�setup_database� )�Common)�iter_domains_data�iter_domain_url_data� )� load_tunables)�ssa_tunables_schema)�report_path)�previous_day_date�sentry_initi c �\ � � e Zd ZdZd � fd� Zd� Zedefd�� � Ze defd�� � Z e defd�� � Ze de fd �� � Zed � � � Zdefd�Zdedefd �Zdedefd�Zdedefd�Zededededefd�� � Zd� Zdefd�Zdefd�Zdedefd�Zd� Zdededefd�Z� xZS )!� DecisionMakerz, SSA Decision maker implementation. Nc �� �� t � � � � � t j d� � | _ | j � dt � � |r|n t � � | _ d S )N�decision_makerzDecisionMaker enabled: %s) �super�__init__�logging� getLogger�logger�info�__package__r �engine)�selfr � __class__s ��Q/opt/cloudlinux/venv/lib64/python3.11/site-packages/ssa/modules/decision_maker.pyr zDecisionMaker.__init__, s_ �� � ���������'�(8�9�9�������4�k�B�B�B� &�<�f�f�N�,<�,<����� c �t � | j � d� � | j � d| j � � | � � � | _ | j � d| j � � | � � � }| � |� � | j � d|� � |S )NzDecisionMaker startedzDecisionMaker loaded config: %sz!DecisionMaker loaded tunables: %szDecisionMaker report: %s)r r �debug�config�load_external_conf�external_tunables�data_processing�add_json_report)r �reports r �__call__zDecisionMaker.__call__3 s� � �����0�1�1�1�����;�T�[�I�I�I�!%�!8�!8�!:�!:�������=�t�?U�V�V�V��%�%�'�'�����V�$�$�$�����3�V�<�<�<�� r �returnc �L � t j � t | � � S )zE Full path to given filename in DM reports directory )�os�path�joinr )�names r �_report_filezDecisionMaker._report_file= s � � �w�|�|�K��.�.�.r c �, � | � d� � S )zU Full path to current DM report: report.json in DM reports directory zreport.json)r. �r s r �current_report_filez!DecisionMaker.current_report_fileD s � � � � ��/�/�/r c �<