Edit File: 161_remove_ea4_main_local_conf.cpython-311.pyc
� �*vhO � � � d Z ddlZddlmZ ddlZddlmZ ej e� � Z ed� � Z ed� � ZdZdZ ej d ee fd �� � Zdd�ZdS ) at Remove /var/cpanel/templates/apache2_4/ea4_main.local file introduced by imunify360. This file was used to change apache log format (%h->%a), when imunify360 installed remote_ip apache module. Since this file is created once it can be outdated after updating cPanel ( in case if /var/cpanel/templates/apache2_4/ea4_main.default also updated). See DEF-9641 for details. � N)�Path)�antivirus_modez./var/cpanel/templates/apache2_4/ea4_main.localz0/var/cpanel/templates/apache2_4/ea4_main.defaultz%a z%h Fc �� � |rd S ddl m} |� � � r�|� � � r}|� � � }|� � � � t t � � }||k r3|� � � t j |j � � d S d S d S d S # t $ r'} t � d|| � � Y d } ~ d S d } ~ ww xY w)Nr )�cPanelzCan't remove %s, reason: %s)�im360.subsys.panels.cpanelr �is_installed�exists� read_text�replace�NEW�OLD�unlink� subprocess� check_call�REBUILD_HTTPDCONF_CMD� Exception�logger�error) �migrator�database�fake�default_conf_path�local_conf_path�kwargsr �origin_text� restored_text�excs �n/opt/imunify360/venv/lib/python3.11/site-packages/defence360agent/migrations/161_remove_ea4_main_local_conf.py�migrater s) � � � ���1�1�1�1�1�1� J���� � � D�_�%;�%;�%=�%=� D�+�5�5�7�7�K�+�5�5�7�7�?�?��S�I�I�M���+�+��&�&�(�(�(��%�f�&B�C�C�C�C�C� D� D� D� D� ,�+�� � J� J� J����2�O�S�I�I�I�I�I�I�I�I�I�����J���s �B!B5 �5 C&�?C!�!C&c � � d S )N� )r r r r s r �rollbackr"