%PDF- %PDF-
Direktori : /lib/python3/dist-packages/cloudinit/net/__pycache__/ |
Current File : //lib/python3/dist-packages/cloudinit/net/__pycache__/freebsd.cpython-312.pyc |
� �f � � � d dl Z d dlZd dlmZmZmZmZ e j e� Z G d� dej j j � Zdd�Z y)� N)�distros�net�subp�utilc �: � � e Zd Zd� fd� Zd� Zd� Zdd�Zd� Z� xZS )�Rendererc �8 �� d| _ t t | � � y )Nr )� _route_cpt�superr �__init__)�self�config� __class__s ��7/usr/lib/python3/dist-packages/cloudinit/net/freebsd.pyr zRenderer.__init__ s �� ���� �h��&�(� c �. � | j d|z |� y )Nzifconfig_%s_name)�set_rc_config_value)r �cur_name�device_names r �rename_interfacezRenderer.rename_interface s � �� � �!3�h�!>��Lr c �2 � | j j � D ]s \ }}t |t � rBd|j d� �d|j d� ��}|j d� }|r|d|z z }n|dk( rd}| j d|z � �u | j j � D ]j \ }}t |t � r@d |j d� |j d � fz }|j d� }|r|d|z z }| j d|z � �l y )Nzinet �addressz netmask �netmask�mtuz mtu %d�DHCP� ifconfig_zinet6 %s/%d�prefixzifconfig_%s_ipv6)�interface_configurations�items� isinstance�dict�getr �interface_configurations_ipv6)r r �v� net_configr s r �write_configzRenderer.write_config s � �"�;�;�A�A�C� L�N�K���!�T�"��E�E�)�$��E�E�)�$�� � �e�e�E�l����)�c�/�1�J��f��#� ��$�$�[�;�%>� �K� L� #�@�@�F�F�H� �N�K���!�T�"�*��E�E�)�$��E�E�(�O�.� � � �e�e�E�l����)�c�/�1�J��$�$�"�[�0�*� � r c � � |st j d� y | j � D ]D }t j j j |t j j � �F t j g d�d�� t j g d�dddg�� | j � D ]D }t j j j |t j j � �F y ) Nz!freebsd generate postcmd disabled)�service�netif�restartT)�capture)r( �routingr* r � )r+ �rcs)�LOG�debug�dhcp_interfacesr �dhcp�IscDhclient�stop_servicer �freebsd�Distror � start_service)r �run�dhcp_interfaces r �start_serviceszRenderer.start_services. s� � ���I�I�9�:��"�2�2�4� �N� �H�H� � �-�-����� 6� 6� � � � � �1�4�@� � � �3�T��1�v�N�"�2�2�4� �N��H�H� � �.�.����� 6� 6� � r c �l � |dk( r| j d|� y |dk( r| j d|� y d| j � �}d|� d|� d|� �}| j d |z |� | j � d|� �| _ | j d | j j � � | xj dz c_ y )Nz0.0.0.0� defaultrouterz::�ipv6_defaultrouterr z-net z -netmask � �route_� static_routesr- )r r �route_names�strip)r �networkr �gateway� route_name� route_cmds r � set_routezRenderer.set_routeH s� � ��i���$�$�_�g�>� ��_��$�$�%9�7�C��t���/�0�J���y� �7�)�1�W�I�F�I��$�$�X� �%:�I�F�"&�"2�"2�!3�1�Z�L�A�D���$�$�_�d�6F�6F�6L�6L�6N�O��O�O�q� �Or �N)F) �__name__� __module__�__qualname__r r r&