File manager - Edit - /usr/lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/digitalocean.cpython-310.pyc
Back
o �Adr � @ s� d dl Z d dlZd dlmZ d dlmZ d dlmZ d dlmZm Z m Z ddd�Ze�e �Zdd d �Zdd� Zdd d�Zdd� Zddd�Zdd� ZdS )� N)�dmi)�log)�net)�subp� url_helper�util�eth0�eth1)�public�privatec C s� |st | �}t�d|� |std��d�t�dd�t�dd��}dd d |d|g}ddd d|dg}t�d�s9td��zt�|� t�d||� t�|� t�d|� W |S t yc t �td||� � 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 � �ip�addr�add�dev�link�set�upz4No 'ip' command available to configure ip4LL addressz#assigned ip4LL address '%s' to '%s'zbrought device '%s' upzRip4LL address assignment of '%s' to '%s' failed. Droplet networking will be broken)�get_link_local_nic�LOG�debug�RuntimeError�format�random�randintr �which� Exceptionr �logexc)�distro�nicr �ip_addr_cmd�ip_link_cmd� r$ �H/usr/lib/python3/dist-packages/cloudinit/sources/helpers/digitalocean.py�assign_ipv4_link_local s>