%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/cloudinit/net/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/cloudinit/net/__pycache__/openbsd.cpython-312.pyc

�

���f�	���ddlZddlZddlZddlmZmZmZeje�Z	Gd�dejjj�Zdd�Z
y)�N)�net�subp�utilc�"�eZdZdd�Zdd�Zd�Zy)�RendererNc��|jj�D]�\}}dj|�}tj|j
|�}||j
�vrd}nWt|t�rG	dj|d|d��}|jd�}|rd	|zz
}d
|jzz
}tj|���y#t$rtjd|�Y�gwxYw)Nzetc/hostname.{}zdhcp
zinet {address} {netmask}�address�netmask)r	r
z#Invalid static configuration for %s�mtuz
mtu %d�
)�interface_configurations�items�formatr�target_path�target�dhcp_interfaces�
isinstance�dict�KeyError�LOG�error�get�interface_routesr�
write_file)�selfr�device_name�v�if_file�fn�contentrs        �7/usr/lib/python3/dist-packages/cloudinit/net/openbsd.py�write_configzRenderer.write_config
s���"�;�;�A�A�C�	)�N�K��'�.�.�{�;�G��!�!�$�+�+�w�7�B��d�2�2�4�4�"���A�t�$��8�?�?� !�)��a�	�l�@��G��e�e�E�l����z�C�/�/�G��4�$�"7�"7�7�7���O�O�B��(�%	)�� ���I�I�=�{���s�8C�C9�8C9c�H�tttj�j	d�d�dkD�}|j
stjd�y|rJtjddgd��|j�D]}tjd	d
d|gd���ytjjj�tjgd�ddd
g��tjgd�ddd
g��tjddgd��y)N�.r�z!openbsd generate postcmd disabled�shz
/etc/netstartT)�capture�dhcpleasectlz-w�30)�route�del�default�)r'�rcs)r*�flushr,)�bool�int�platform�release�split�	_postcmdsr�debugrrr�dhcp�IscDhclient�kill_dhcp_client)r�run�has_dhcpleasectl�	interfaces    r!�start_serviceszRenderer.start_services"s�����H�$4�$4�$6�$<�$<�S�$A�!�$D� E�� I�J���~�~��I�I�9�:����I�I�t�_�-�t�<�!�1�1�3�
�	��	�	�#�T�4��;�T��
�

�H�H� � �1�1�3��I�I�1�4�a��V�L��I�I�3�T��1�v�N��I�I�t�_�-�t�<�c���|dk(r>d}tj|j|�}|dz}tj||�y|j
dz|zdz|zdz|zdz|_y)Nz0.0.0.0z
etc/mygaterz!route add z
 -netmask � )rrrrrr)r�networkr
�gatewayrrr s       r!�	set_routezRenderer.set_route3s����i��"�G��!�!�$�+�+�w�7�B���n�G��O�O�B��(��%�%�� ������	�
���
���
�!r>�N)F)�__name__�
__module__�__qualname__r"r=rC�r>r!rrs��)�*=�"r>rc�*�tj�SrD)r�
is_OpenBSD)rs r!�	availablerKFs���?�?��r>rD)�loggingr2�cloudinit.net.bsd�	cloudinitrrr�	getLoggerrEr�bsd�BSDRendererrrKrHr>r!�<module>rRsJ�����%�%��g����!��7�y�}�}� � �,�,�7�tr>

Zerion Mini Shell 1.0