Current File : //usr/lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/digitalocean.cpython-312.pyc |
�
x[h� � � � d dl Z d dlZd dlZd dlmZ d dlmZ d dlmZmZ ddd�Z ej e� Zdd�Z
d � Zdd
�Zd� Zdd�Zd
� Zy)� N)�dmi)�net)�
url_helper�util�eth0�eth1)�public�privatec �� � |s!t | � }t j d|� |st d� �dj t j dd� t j dd� � } | j j ||� | j j |� t j d||� |S # t $ r t j t d ||� � w xY w)
z�Bring up NIC using an address using link-local (ip4LL) IPs.
On DigitalOcean, the link-local domain is per-droplet routed, so there
is no risk of collisions. However, to be more safe, the ip4LL
address is random.
z,selected interface '%s' for reading metadatazPunable to find interfaces to access themeta-data server. This droplet is broken.z169.254.{0}.{1}/16� � r � z&brought device '%s' up with address %szRip4LL address assignment of '%s' to '%s' failed. Droplet networking will be broken)
�get_link_local_nic�LOG�debug�RuntimeError�format�random�randint�net_ops�add_addr�link_up� Exceptionr �logexc)�distro�nic�addrs �H/usr/lib/python3/dist-packages/cloudinit/sources/helpers/digitalocean.py�assign_ipv4_link_localr s� � � � ��(��� � �@�#�F���
8�
�
�
�&�&����q�#�����q�#� 6��D��������T�*������s�#�� � �:�C��F� �J�� � �����
1���
� ��s
�,AB<