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/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

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

}��fa�@s�dZddlZddlmmmZddlmZm	Z	mZm
Z
ddlmZddl
mZe�e�ZdZededd	�Zd
ZdZdZGdd
�d
ej�Zdd�ZeejffgZdd�ZdS)z;Hetzner Cloud API Documentation
https://docs.hetzner.cloud/�N)�dmi�net�sources�util)�NoDHCPLeaseError)�EphemeralDHCPv4z!http://169.254.169.254/hetzner/v1z	/metadataz	/userdata)�metadata_url�userdata_url�<�c@s4eZdZdZdd�Zdd�Zdd�Zedd	��Zd
S)�DataSourceHetzner�HetznercCs�tj�||||�||_t�|_t�t�|ddgi�t	g�|_
|j
d|_|j
d|_|j
�
dt�|_|j
�
dt�|_|j
�
dt�|_tj|_tj|_d|_dS)N�
datasourcer
rr	�retries�timeout�
wait_retry)r�
DataSource�__init__�distro�dict�metadatar�
mergemanydict�get_cfg_by_path�BUILTIN_DS_CONFIG�ds_cfg�metadata_address�userdata_address�get�
MD_RETRIESr�
MD_TIMEOUTr�
MD_WAIT_RETRYr�UNSET�_network_config�DSMODE_NETWORK�dsmode�
metadata_full)�self�sys_cfgr�paths�r)�E/usr/lib/python3/dist-packages/cloudinit/sources/DataSourceHetzner.pyr"s ��
zDataSourceHetzner.__init__c
Cs&t�\}}|s	dSz:t|jt��dtdid��"tj|j|j	|j
|jd�}tj|j
|j	|j
|jd�}Wd�n1s=wYWntyV}zt�d|��d}~wwt�|�|_||_|d|jd<|d|jd	<|�d
d�|jd
<|�dd�|jd<|�dd�|_|��|kr�td
��dS)NF�urlz/metadata/instance-id)�iface�connectivity_url_data)r�sec_betweenrzBailing, DHCP Exception: %szinstance-id�hostnamezlocal-hostname�network-configzpublic-keys�vendor_dataz6SMBIOS serial does not match instance ID from metadataT)�get_hcloud_datarrr�find_fallback_nic�BASE_URL_V1�	hc_helper�
read_metadatarrrr�
read_userdatarr�LOG�errorr�maybe_b64decode�userdata_rawr%rr�vendordata_raw�get_instance_id�RuntimeError)r&�
on_hetzner�serial�md�ud�er)r)r*�	_get_data5sR
���������zDataSourceHetzner._get_datacCst�|��d�S)N�system-serial-number)r�instance_id_matches_system_uuidr=)r&r'r)r)r*�check_instance_idns�z#DataSourceHetzner.check_instance_idcCsT|jdurt�dtj�tj|_|jtjkr|jS|jd}|s$td��||_|jS)z�Configure the networking. This needs to be done each boot, since
        the IP information may have changed due to snapshot and/or
        migration.
        Nz5Found None as cached _network_config. Resetting to %sr0z'Unable to get meta-data from server....)r"r8�warningrr!rr>)r&�_net_configr)r)r*�network_configss
�
z DataSourceHetzner.network_configN)	�__name__�
__module__�__qualname__�dsnamerrDrG�propertyrJr)r)r)r*rs9rcCs@t�d�}|dkrdSt�d�}|rt�d|�d|fStd��)Nzsystem-manufacturerr
)FNrEz#Running on Hetzner Cloud: serial=%sz+Hetzner Cloud detected, but no serial foundT)r�
read_dmi_datar8�debugr>)�vendor_namer@r)r)r*r2�s

�r2cCst�|t�S)N)r�list_from_depends�datasources)�dependsr)r)r*�get_datasource_list�srV)�__doc__�logging�!cloudinit.sources.helpers.hetznerr�helpers�hetznerr5�	cloudinitrrr�cloudinit.net.dhcpr�cloudinit.net.ephemeralr�	getLoggerrKr8r4rrrr rrr2�DEP_FILESYSTEMrTrVr)r)r)r*�<module>s&
�o
�

Spamworldpro Mini