관리-도구
편집 파일: snapshot_saver.cpython-311.pyc
� �Cg@ � �Z � d dl Z d dlZd dlmZ d dlmZmZmZmZ d dl Z d dlmZ d dl mZ d dlmZ d dlmZ d dlmZ d d lmZ d d lmZ d dlmZmZ d dlmZ d d lmZm Z m!Z! d dl"m#Z# d dl$m%Z%m&Z&m'Z' d dl(m)Z) dZ*dZ+dZ,dZ-dZ. G d� de/� � Z0 G d� de/� � Z1 G d� de� � Z2dS )� N��choice)�Dict�List�Optional�Tuple)�sessionmaker)�ClPwd)�NotSupported)�NoDBAccessData)�ExternalProgramFailed)�LveStatsPlugin)� proctitle)� get_chunks�reboot_lock)�HtpasswdFile)� LiteSpeed�LiteSpeedException�LiteSpeedInvalidCredentials)�Snapshot)�MySQLOperationalError�SQLSnapshot� get_lveps��incidenti, � � �apache� litespeedc �B � e Zd Zd� Zd� Zd� Zd� Zed� � � Zd� Z dS )�LitespeedHelperc �~ � d| _ d| _ d | _ d| _ | � � � | _ d| _ d S )NFzlve-stats-admin)� is_running� state_changed�force_litespeed�login�generate_random_password�password� broken_config��selfs ��/builddir/build/BUILDROOT/lve-stats-4.2.10-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/plugins/generic/snapshot_saver.py�__init__zLitespeedHelper.__init__% sE � ����"��� $��� '�� ��5�5�7�7�� �"����� c �Z � t j � � }|| j k | _ || _ dS )zCheck litespeed stateN)r �is_litespeed_runningr# r$ )r+ �litespeed_runnings r, �check_litespeed_statez%LitespeedHelper.check_litespeed_state5 s+ � �%�:�<�<��.�$�/�A���+����r. c �: � t t j � � }n7# t $ r* d| _ t j dt j � � Y d S w xY w|� | j | j � � |� � � t j d� � d S )NTz8Can't change the password. Please, check the file: '%s'zPassword successfully changed.)r r � HTPASSWD_PATH� ValueErrorr) �logging�warning�updater&