관리-도구
편집 파일: migration_ve1_to_v2.cpython-311.pyc
� �EBg� � �Z � d dl Z d dlZd dlZd dlmZ d� Zd� Zedk r e� � dS dS )� N)� ve_configc �� � dt t j � � � � z }t |d� � 5 }|� | � d�� � � � d d d � � d S # 1 swxY w Y d S )Nz/etc/container/ve.cfg.�wbzutf-8)�encoding)�str�time�open�write�toxml)�xml�BACK_IP_NAME�backups �py/migration_ve1_to_v2.py� create_backupr s� � �+�c�$�)�+�+�.>�.>�>�L� �l�D� !� !� 2�V����S�Y�Y��Y�0�0�1�1�1�2� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2� 2���� 2� 2� 2� 2� 2� 2s �*A+�+A/�2A/c �h � t j d� � t j � � t j dk rt j d� � t t j � � t j � d� � } t | � � dk rpt j � d� � }|� t j � d� � � � t j � |� � t j d� � t j � � � }t j D ]�}d}d}|� d� � |v rd}t j |� d� � � � }t |� � dk rd }nt |� � d k r |d }nd}|r|�|r6t) d t+ |� d� � � � z dz � � ��|�|� d|� � ��t/ j t j � � d S ) NT� r �version�2z list-packagesF�id� zPackage z is duplicated. Skipped.�reseller)� lvectllib�get_global_lock�get_XML_cfg�ve_cfg_version�sys�exitr �ve_cfg�ve_lveconfig�getElementsByTagName�len� createElement�appendChild�createTextNode�GetControlPanelUsers�packages_users�copy� ve_package�getAttribute�guess_reseller_by_package�printr �setAttributer �save_xml)r �ve_cfg_vers�packages�package�found_in_standalone�found_in_reseller� reseller_listr s r �mainr4 s � � ��d�#�#�#� �������1�$�$��������)�"�#�#�#��+�@�@��K�K�N� �>���a����&�4�4�Y�?�?����� � 0� ?� ?�� D� D�E�E�E���*�*�;�7�7�7� �"�?�3�3�3��'�,�,�.�.�H��'� 7� 7��#��!������%�%��1�1�"&��!�;�G�<P�<P�QU�<V�<V�W�W� ��}����"�"��H�H� �� � �1� $� $�$�Q�'�H�H� $��� �H�$8�=N�$8��*�s�7�#7�#7��#=�#=�>�>�>�A[�[�\�\�\����� � ��X�6�6�6�� ��y�'�(�(�(�(�(� �__main__)r r r � clveconfigr r r4 �__name__� r5 r �<module>r: sz �� � � � � ���� � � � � � � � � � �2� 2� 2�$)� $)� $)�N �z����D�F�F�F�F�F� �r5