| Server IP : 3.96.16.70 / Your IP : 216.73.216.15 Web Server : Apache System : Linux ip-172-31-26-103.ca-central-1.compute.internal 6.1.163-186.299.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Feb 24 16:35:42 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.18 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3.9/site-packages/cloudinit/sources/__pycache__/ |
Upload File : |
a
ꬊh�5 � @ s� d Z ddlZddlZddlZddlmZ ddlmZmZm Z m
Z
mZmZm
Z
ddlZddlmZ ddlmZ ddlmZ ddlmZ dd lmZmZmZ e�e�Zd
ZdZdd
ddd
dd�Z e!d�dd�Z"G dd� de�Z#G dd� de�Z$G dd� de�Z%e&e!d�dd�Z'G dd� dej(�Z)e*d�dd�Z+ed fe&e*e!d!�d"d#�Z,e)ej-ffgZ.d$d%� Z/ed&k�r�ddl0Z0d'Z1e0j2e1d(�Z3e3�4� e5e�6e,� �� dS ))a� Datasource for LXD, reads /dev/lxd/sock representaton of instance data.
Notes:
* This datasource replaces previous NoCloud datasource for LXD.
* Older LXD images may not have updates for cloud-init so NoCloud may
still be detected on those images.
* Detect LXD datasource when /dev/lxd/sock is an active socket file.
* Info on dev-lxd API: https://linuxcontainers.org/lxd/docs/master/dev-lxd
* TODO( Hotplug support using websockets API 1.0/events )
� N)�JSONDecodeError)�Any�Dict�List�Optional�Tuple�Union�cast)�HTTPAdapter)�HTTPConnection)�HTTPConnectionPool)�log)�sources�subp�utilz
/dev/lxd/sockz1.0� user-data�network-config�vendor-data)�cloud-init.user-datazcloud-init.network-config�cloud-init.vendor-data�user.user-datazuser.network-config�user.vendor-data��returnc
C s� dddddd�gd�gd�} t �d �r�zt � d g�\}}W n6 t jyp } zt�d
|� | W Y d}~S d}~0 0 |�� dv r�t�� d
d }|dkr�d| d d d<