%PDF- %PDF-
Direktori : /snap/core22/2082/lib/python3/dist-packages/cloudinit/distros/__pycache__/ |
Current File : //snap/core22/2082/lib/python3/dist-packages/cloudinit/distros/__pycache__/ubuntu.cpython-310.pyc |
o NhF � @ sd d dl Z d dlZd dlmZmZ d dlmZ d dlmZ d dl m Z e�e�Z G dd� dej�ZdS )� N)�PREFERRED_NTP_CLIENTS�debian)�Snap)� activators)�CLOUDINIT_NETPLAN_FILEc s@ e Zd Z� fdd�Zd� fdd� Zedd� �Zdd d �Z� ZS ) �Distroc sd t � �|||� dtd�| _| jd tjd�| jd tjdd�d�| _t| j�| _ | j �| j � d S )Nz+/etc/network/interfaces.d/50-cloud-init.cfg)�eni�netplanr )�eni_path� eni_headerr T)�netplan_path�netplan_header�postcmds)�super�__init__r �network_conf_fnr �NETWORK_FILE_HEADER�renderer_configsr �_runner�snap�package_managers�append)�self�name�cfg�paths�� __class__� �:/usr/lib/python3/dist-packages/cloudinit/distros/ubuntu.pyr s ����zDistro.__init__Nc s, t � �|||� | j�� r| j�� d S d S )N)r �package_commandr � available�upgrade_packages)r �command�args�pkgsr r r r - s �zDistro.package_commandc C s | j s t�t�| _ | j S )z5The preferred ntp client is dependent on the version.)�_preferred_ntp_clients�copy�deepcopyr )r r r r �preferred_ntp_clients2 s zDistro.preferred_ntp_clients�returnc C sb z| j �� W dS tjy t�d� Y dS ty0 } z t�d|� W Y d}~dS d}~ww )zAEnsure that cloud-init's network service has network connectivityz6Failed to wait for network. No network activator foundzFailed to wait for network: %sN)�network_activator�wait_for_networkr �NoActivatorException�LOG�error� Exception)r �er r r r, 9 s ��zDistro.wait_for_network)NN)r* N) �__name__� __module__�__qualname__r r �propertyr) r, � __classcell__r r r r r s r )r'