Spamworldpro Mini Shell
Spamworldpro


Server : Apache/2.4.52 (Ubuntu)
System : Linux webserver 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64
User : www-data ( 33)
PHP Version : 8.1.2-1ubuntu2.21
Disable Function : NONE
Directory :  /lib/python3/dist-packages/cloudinit/sources/helpers/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

}��f��@s�ddlZddlZddlmZddlmZddlmZmZm	Z	m
Z
mZddlm
Z
ddlmZe�e�Ze�	d$dd��Zd	d
�Zdd�Zd
d�Zdd�Zdd�Zdd�Ze�dd��Zdd�Zdd�Zd%dd�Zdd�Zd d!�Zd"d#�Z dS)&�N)�	lru_cache)�
exceptions)�dmi�net�subp�
url_helper�util)�NoDHCPLeaseError)�EphemeralDHCPv4cCs�td�}t�D]S}z1t||d|id��t|||||�}	t�|	�}
t|
�|
Wd�WS1s4wYWqttj	tt
jfyZ}zt�
d|�|}WYd}~qd}~ww|�)NzFailed to DHCP�url)�iface�connectivity_url_datazDHCP Exception: %s)�RuntimeError�get_interface_listr
�
read_metadata�json�loads�refactor_metadatar	r�ProcessExecutionErrorr�RequestException�LOG�error)�distror�timeout�retries�sec_between�agent�tmp_dir�	exceptionr�v1�metadata�exc�r"�A/usr/lib/python3/dist-packages/cloudinit/sources/helpers/vultr.py�get_metadatas0
�
*����r$cCsL|d|d<|d|d<|dd}d|dvr|dd}|��|d<dS)Nzinstance-v2-idzinstance-id�hostnamezlocal-hostname�region�
regioncode�countrycode)�lower)r r&r"r"r#r4srcCs*g}t��D]}d|vr
q|�|�q|S)N�dummy)r�find_candidate_nics�append)�ifacesrr"r"r#r>srcCst�d�t�d�d�S)Nzsystem-manufacturerzsystem-serial-number)�manufacturer�subid)r�
read_dmi_datar"r"r"r#�get_sysinfoJs�r1cCst�ddkr	dSdS)Nr.�VultrTF)r1r"r"r"r#�is_baremetalRsr3cCs.t�}|ddkrdSdt����vrdSdS)Nr.r2T�vultrF)r1r�get_cmdline�split)�sysinfor"r"r#�is_vultrYsr8cCsHd|}d|d�}tj|||||d�}|��std||j��|j��S)Nz
%s/v1.json�	cloudinit)zMetadata-Tokenz
User-Agent)rr�headersrz!Failed to connect to %s: Code: %s)r�readurl�okr�code�contents�decode)rrrrrr:�responser"r"r#rhs
�
�
rcCst��S�N)r�get_interfaces_by_macr"r"r"r#�get_interface_map�srCcCst�}||vr	dS|�|�SrA)rC�get)�mac�macs_to_nicr"r"r#�get_interface_name�s
rGcCs�ddddgd�gd�}t|�dkr t|ddd	�}|d
�|�tdt|��D]}||}|�d�r3q't|�}|d
�|�q'|S)N��
nameserverz108.61.10.10z2001:19f0:300:1704::6)�type�address)�version�configrT)�primaryrM�unconfigured)�len�generate_interfacer,�rangerD)�
interfaces�network�public�i�	interface�privater"r"r#�generate_network_config�s ���
rYFcCs�t|d�}|std|d��|d|dd�}|r*d|d<ddd	�d
dd	�g|d<|s>dd|d
d|d
dd�g|d<t||�t||�|S)NrE�.Interface: %s could not be found on the system�physical)�namerJ�mac_addressrH�	accept-ra�dhcp�auto)rJ�control�
ipv6_slaac�subnets�static�ipv4rK�netmask�rJrarKrf)rGr�generate_interface_routes�'generate_interface_additional_addresses)rWrN�interface_name�netcfgr"r"r#rQ�s0
���

��
	
rQcCsLd|vr
|d|d<d|vr|d|d<d|vr$|d|ddd<dSdS)N�mtur^�routesrcrr")rWrkr"r"r#rh�s�rhcCs�t|dd�}d|vr5|dkr5|ddD]}dd|d|dd�}d	|vr-|d	|d	<|d
�|�qt|dd�}d|vrm|dkro|ddD]%}ddd
|d|dfd�}d	|vre|d	|d	<|d
�|�qKdSdSdS)Nre�
additionalrrdr`rKrfrgrmrc�ipv6�static6z%s/%srT�prefix)rJrarK)rPr,)rWrk�additional_countrn�addr"r"r#ri�s2����ricCsH|dD]}|ddkr
qt|d�}|std|d��||d<qdS)NrMrJr[r]rZr\)rGr)rkrWrjr"r"r#�add_interface_namess��
�rtrA)F)!r�logging�	functoolsr�requestsrr9rrrrr�cloudinit.net.dhcpr	�cloudinit.net.ephemeralr
�	getLogger�__name__rr$rrr1r3r8rrCrGrYrQrhrirtr"r"r"r#�<module>s2
� 



%#

Spamworldpro Mini