Edit File: lib.cpython-311.opt-1.pyc
� �e� � �2 � d dl mZ d dl mZ d dl mZ d dlZd dlZd dlZd dlZd dlZd dl m Z mZmZ d dl mZmZmZ d dlmZmZmZ dZd Zd ZdZej � ed� � Z ej e� � Zdd�Zd� Z d� Z!d� Z"d� Z#d� Z$d� Z%d� Z&d� Z'd� Z(dS )� )�print_function)�absolute_import)�divisionN)�POST_MODIFY_DOMAIN�PRE_MODIFY_USER�POST_MODIFY_USER)�run_command�ExternalProgramFailed�is_user_present)�makedirs_secure�write_file_secure�read_file_secure� z'Unable to find username in hook cmdlinez/usr/sbin/whmapi1z/var/lve�tmpTc �T � |st dd| z � � dS t dd� � dS )a cPanel expects that each custom hook prints two values in the end of the execution: - status, where 1 means success - message, which explains non-1 statuses otherwise nothing really breaks, but logs are full of "script returned invalid response" msgs :param hook_name: name, path or anything else to fill message with in order to understand what exactly failed :param success: is it everything ended successfully? :return: Nothing r z�Failed to execute hook %s; you can find logs in /var/log/cloudlinux/hooks/info.log and contact CloudLinux Support if you need help with the issue.r �OkN)�print)� hook_name�successs ��/builddir/build/BUILDROOT/alt-python27-cllib-3.3.5-1.el8.cloudlinux.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/clcommon/public_hooks/bundle/cpanel/lib.py�print_responser $ sL � � � � �a� (� +4�4� 5� 5� 5� 5� 5� �a������� c �� � t j ddgt j t j d�� � } | � � � \ }}| j dk r$t � d| j ||� � dS dS )z^ Run lvectl sync-map and log possible stdout|err in case of errors. :return: None �lvectlzsync-mapT)�stdout�stderr�textr z�Error during "lvectl sync-map", code: %s, stderr: `%s`, stdout: `%s`. Reseller limits kernel mapping might be not synchronized.Contact CloudLinux Support for help.N)� subprocess�Popen�PIPE�communicate� returncode�logger�error)�pr r s r � call_sync_mapr&