Hacked By AnonymousFox

Current Path : /opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/utils/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/lvestats/utils/__pycache__/v1import.cpython-311.pyc

�

)�f:��l�ddlmZddlmZddlZdZdZdZdZdZd	Z	d
Z
dZdZd
Z
d�Zd�Zd�Zd�Zd�ZdS)�)�print_function)�absolute_importNz/etc/sysconfig/lvestatsz/etc/sysconfig/lvestats2z /etc/sysconfig/cloudlinux-notifyz0/etc/sysconfig/lvestats.config/StatsNotifier.cfgz1/usr/share/lve-stats/utils/import-settings-statusz//etc/sysconfig/lvestats.config/V1DBMigrator.cfgzsqlite:////var/lve/lveinfo.dbz4/usr/share/lve-stats/plugins.other/v1_db_migrator.pyz./usr/share/lve-stats/plugins/v1_db_migrator.py�v1_connect_stringc��t|vrtd��dSd|vrd|d<ttd��5}|�d|d�d|t�d���ddd��n#1swxYwY	t
j�t��s!tj	tt��dSdS#ttf$r*}tdt|��z��Yd}~dSd}~wwxYw)	Nz.Cannot find db info to enable migration plugin�	server_id�	localhost�wz
v1_server_id=z
v1_connect_string=�
z4Unable to enable db migration plugin: %s, continue: )�V1_KEY�print�open�V1_DB_MIIGRATOR_CONFIG�write�os�path�lexists�V1_DB_MIIGRATOR_PLUGIN_LINK�symlink�V1_DB_MIIGRATOR_PLUGIN_SRC�IOError�OSError�str)�config�cfg�es   ��/builddir/build/BUILDROOT/lve-stats-4.2.8-1.el8.x86_64/opt/cloudlinux/venv/lib/python3.11/site-packages/lvestats/utils/v1import.py�init_v1_db_migratorrsr��
�V���
�>�?�?�?����&� � �)��{��	
�$�c�	*�	*�e�c��	�	�	�v�k�?R�?R�?R�TZ�[a�Tb�Tb�Tb�c�d�d�d�e�e�e�e�e�e�e�e�e�e�e����e�e�e�e�Q��w���:�;�;�	P��J�1�3N�O�O�O�O�O�	P�	P���W��Q�Q�Q�
�D��A���O�P�P�P�P�P�P�P�P�P�����Q���s*�.A3�3A7�:A7�?AC�D�C<�<Dc�2�tj�t��rrt	td��}|���}|���	t|��S#t$rtdtz���wxYwdS)N�rz!Invalid status format for file %sr)
rr�exists�IMPORT_STATUS_FILEr
�read�close�int�
ValueError�	Exception)�f�vs  r�get_import_statusr)-s���	�w�~�~�(�)�)�	��#�S�)�)��
�F�F�H�H��	���	�	�	�	V��q�6�6�M���	V�	V�	V��?�BT�T�U�U�U�	V�����qs�#A2�2"Bc��ttd��}|�d|z��|���dS)Nr	z%d)r
r!rr#)�flagr's  r�set_import_statusr,:s9���
��%�%�A��G�G�D�4�K�����G�G�I�I�I�I�I�c��tj�|��r|Stj�|dz��r|dzSdS)Nz.rpmsave�)rrr )rs r�get_config_pathr0@sH��	�w�~�~�d���!���	�����z�)�	*�	*�!��j� � �
�2r-c�d�d|vr�d|vr�|ddvr~|d�d��}|d}|d}|d}|d}|dz|zd	z|zd
z|z|d<d�|d|d��|t<dS|ddkrt|t<dSdSdS)
N�db_type�connect_string)�mysql�
postgresql�:r����@�/z	{0}://{1}�sqlite)�split�formatr�V1_SQLITE_DB)�lvestats_configr3�host�database�user�passwords      r�get_connection_stringrEHs����O�#�#���.�.�?�9�3M�Qh�3h�3h�,�-=�>�D�D�S�I�I�N�!�!�$�D�%�a�(�H�!�!�$�D�%�a�(�H�04�s�
�X�0E��0K�d�0R�UX�0X�[c�0c�O�,�-�&1�&8�&8���9S�Ud�eu�Uv�&w�&w�O�F�#�#�#�
�Y�
'�8�
3�
3�&2�O�F�#�#�#�$�#�4�
3r-)�
__future__rrr�CONFIG_PATH_v1�CONFIG_PATH_v2�NOTIFY_PATH_v1�NOTIFY_PATH_v2r!rr?rrrrr)r,r0rE�r-r�<module>rLs���&�%�%�%�%�%�&�&�&�&�&�&�	�	�	�	�*��+��3��C��H��J��.��S��N��	��Q�Q�Q�$
�
�
�������3�3�3�3�3r-

Hacked By AnonymousFox1.0, Coded By AnonymousFox